/* Targeted fix for six Hermes problems. No changes to protected modules. */
/* Reserve genuine, separate space for the figure, label, details, transcript
   and Mission Control CTA; do not solve this with z-index tricks. */
@media(min-width:781px) {
  .page[data-view="home"] .gridspace,
  .page[data-view="levels"] .gridspace,
  .page[data-view="about"] .gridspace,
  .page[data-view="agents"] .gridspace {
    min-height:860px !important;height:860px !important;
  }
  .page .character {top:0 !important;right:6% !important;height:630px !important;}
  .page .character-details {
    position:absolute !important;top:27% !important;right:0.5% !important;
    max-width:158px;min-width:140px;z-index:6;pointer-events:none;
  }
  .page #character-label {
    top:auto !important;bottom:4% !important;left:8% !important;
    right:auto !important;max-width:52% !important;
    white-space:nowrap;font-size:10px !important;line-height:1.2;
    z-index:8;
  }
  .page #hermes-entry,.page #hermes-entry.is-open {
    position:absolute !important;top:718px !important;bottom:auto !important;
    right:4% !important;left:auto !important;width:max-content;
    max-width:33% !important;z-index:10;margin:0 !important;
    white-space:normal;line-height:1.4;text-align:center;
  }
  .page #hermes-voice-transcript {
    position:absolute;top:710px;bottom:auto;right:43%;left:auto;
    width:38%;max-width:520px;min-height:66px;z-index:10;
  }
  .page[data-view="agents"] #cards {margin-top:0 !important;}
}
/* The original character artwork never bounces or rotates as a slab. */
.page .character,.page .character:hover,.page .character.activated {
  transform:none !important;transition:filter .45s ease;
}
.page .character .portrait,
.page .character:hover .portrait,
.page .character.activated .portrait,
.page .character.hermes-speaking .portrait {
  transform:none !important;animation:none !important;
  background-position:center bottom !important;background-size:contain !important;
  filter:contrast(1.065) brightness(1.045);
}
.page .character .portrait::before,
.page .character .portrait::after,
.page .character.hermes-speaking .portrait::after {content:none !important;animation:none !important;}
.page .hermes-face-canvas {
  position:absolute;inset:0;z-index:4;pointer-events:none;
  max-width:none;transform:none;mix-blend-mode:normal;
}
.page .character .glow {
  opacity:.18;animation:hermesFieldPulse 7.7s ease-in-out infinite !important;
}
.page .character .core-light {
  opacity:.4;animation:hermesFieldPulse 3.9s ease-in-out infinite !important;
}
@keyframes hermesFieldPulse {
  0%,100% {opacity:.18;filter:brightness(.92);}
  40% {opacity:.56;filter:brightness(1.25);}
  72% {opacity:.30;filter:brightness(1.05);}
}
.page #hermes-voice-transcript {
  display:none;box-sizing:border-box;padding:12px 18px;
  background:linear-gradient(105deg,#0a171adf,#061519d8);
  border:1px solid #79d7c799;border-left:3px solid #b5fff2;
  color:#d6fff4;font:700 12px/1.5 'Courier New',monospace;
  align-items:center;justify-content:flex-start;letter-spacing:.025em;
  box-shadow:0 8px 22px #0006;
}
.page.hermes-speaking #hermes-voice-transcript,
.page.hermes-caption-fallback #hermes-voice-transcript {display:flex;}
/* Never leave the older full-width speech card behind. */
.page .character .hermes-speech-caption {display:none !important;}
/* Mission Control stays an ordinary navigation link: no modal overlays. */
.page #hermes-entry {pointer-events:auto;}
@media(max-width:780px) {
 .page .gridspace {display:flex !important;flex-direction:column;min-height:0 !important;
   height:auto !important;padding-bottom:26px !important;overflow:visible;}
 .page .character {position:relative !important;order:3;top:auto !important;
   right:auto !important;left:auto !important;width:min(96%,440px);
   height:450px !important;margin:0 auto;}
 .page #character-label {position:absolute;top:auto !important;bottom:6% !important;
   left:4% !important;right:auto !important;max-width:92%;
   padding:8px 12px;font-size:9px !important;}
 .page .character-details {order:4;position:relative !important;top:auto !important;
   left:auto !important;right:auto !important;max-width:80%;width:225px;
   margin:12px auto 7px;align-self:center;z-index:8;pointer-events:none;}
 .page #hermes-voice-transcript {order:5;position:relative;top:auto;bottom:auto;
   left:auto;right:auto;margin:10px auto;max-width:96%;width:min(96%,480px);
   min-height:65px;font-size:11px;}
 .page #hermes-entry,.page #hermes-entry.is-open {
   order:6;position:relative !important;top:auto !important;bottom:auto !important;
   right:auto !important;left:auto !important;max-width:95% !important;
   align-self:center;margin:10px auto 15px !important;
 }
}
@media(prefers-reduced-motion:reduce) {
  .page .character .glow,.page .character .core-light {animation:none !important;}
}
/* The original photograph is redrawn in one seamless deformable canvas.
   Hide the original background only after the canvas paints its first frame. */
.page .character .portrait.hermes-procedural-ready,
.page .character.activated .portrait.hermes-procedural-ready {
  background-image:none !important;
}

/* Approved original-transparent artwork, 10 October 2026.
   Single 420x710 alpha portrait, shared with its WebGL canvas. The old
   photograph fragments must not remain under or over the clean portrait.
   No geometric mask, artificial fade, or extra eye/lip overlay is applied. */
.page .character .portrait {
  inset: auto !important;
  top: 0 !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  height: 100% !important;
  aspect-ratio: 420 / 710;
  translate: -50% 0;
  background-image: url('/approved-homepage-assets/hermes-approved-clean.webp') !important;
  background-size: 100% 100% !important;
  background-position: center bottom !important;
  background-repeat: no-repeat !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  overflow: visible;
}
.page .character .portrait.hermes-procedural-ready,
.page .character.activated .portrait.hermes-procedural-ready {
  background-image: none !important;
}
.page .character .body-figure,
.page .character .head-figure {
  display: none !important;
}


/* Public landing parity fix: readable studio-style scene and stable split-flap tabs.
   Scoped to the cinematic public page, never the staff application. */
.page .backdrop {
  background-image:
    linear-gradient(90deg,rgba(2,4,7,.61) 0%,rgba(2,4,7,.36) 42%,rgba(2,4,7,.20) 73%,rgba(2,4,7,.36) 100%),
    url('/approved-homepage-assets/scene-1.webp') !important;
  filter: grayscale(.28) contrast(1.07) brightness(.99) !important;
}
.page .top .tabs button {
  transform:none !important;
  scale:1 !important;
  filter:none !important;
  text-shadow:none !important;
  transition:background-color .16s ease,color .16s ease;
}
.page .top .tabs button.split-flap-active {
  transform:none !important;
  scale:1 !important;
  filter:none !important;
  text-shadow:none !important;
}
.page .top .tabs button:hover:not([aria-selected="true"]) {
  background:transparent !important;
  color:#f1f5f6 !important;
}
.page .top .tabs button:hover:not([aria-selected="true"]) .nav-flap-overlay {
  color:#f1f5f6 !important;
}
.page .top .tabs #studio-nav:hover {
  background:transparent !important;
  color:#f1f5f6 !important;
}
.page .top .tabs #studio-nav .nav-flap-overlay {
  pointer-events:none !important;
}
