/* Part scenes (2026-11-22, phase 2 of ~/.claude/plans/hub-poster-headers.md):
   the Bills, Trips and Cars landings open with the hub scene the MaliTools and
   MaliGames hubs had until the poster (hub.css + hub.js). The scene has the
   part's floating stickers, a flat poster Mali (images/poster/<part>.webp) in
   the badge's place, the part's name, the landing's keyword H1 as the line
   under it and the one main button. Under it comes a sheet of swipe pages of
   that part's tools (chips and dots from hub.js), then the job strip. The
   band, LINE, FAQ, how-to and SEO blocks below are unchanged.
   Loaded last, after landing-job.css and hub.css, by those three pages only. */

/* desktop: the landing's main is a plain block; flow-root keeps the scene's
   negative top margin from collapsing through it (hub.js lift()) */
@media (min-width: 761px) { html:not(.cz-app) body main.hm.ap-page { display: flow-root; } }

/* the middle: Mali, the name, the H1, the button */
html:not(.hub-off) .ps-scene .ps-mid { bottom: 72px; }
.ps-scene .ps-mali {
  display: block; width: auto; height: clamp(108px, calc(var(--hub-h, 400px) * .36), 230px); max-width: none;
  margin: 0 0 6px; filter: drop-shadow(0 16px 22px rgba(60, 10, 0, .28));
}
html[data-theme="dark"] .ps-scene .ps-mali { filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .6)); }
html:not(.hub-off) .ps-scene .hub-name { margin: 0; }
html:not(.hub-off) body .ps-scene .hub-tag { max-width: 34ch; margin-top: 6px; font-size: clamp(18px, 1.5vw, 21px); text-wrap: balance; }

/* the one main action: an ink pill on the orange day scene, Rocket Orange at night */
.ps-scene .ps-go {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; margin-top: 14px; padding: 6px 6px 6px 22px;
  border-radius: 999px; background: #111111; color: #f3eee3; text-decoration: none;
  font: 600 16px/1.2 "Chakra Petch", SukhumvitSet, Inter, sans-serif; letter-spacing: .02em;
  box-shadow: 0 12px 26px -14px rgba(17, 17, 17, .8); transition: transform 160ms, box-shadow 200ms;
}
.ps-scene .ps-go i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #ff4b2b; color: #111111; font-style: normal; font-weight: 700; }
.ps-scene .ps-go:hover { box-shadow: 0 16px 30px -14px rgba(17, 17, 17, .9); }
.ps-scene .ps-go:active { transform: scale(.97); }
.ps-scene .ps-go:focus-visible { outline: 2px solid #f3eee3; outline-offset: 3px; }
html[data-theme="dark"] .ps-scene .ps-go { background: #ff4b2b; color: #111111; box-shadow: 0 10px 28px -14px rgba(255, 75, 43, .7); }
html[data-theme="dark"] .ps-scene .ps-go i { background: #111111; color: #f3eee3; }

/* short scenes (hub.js .hub-short / .hub-tiny) */
html:not(.hub-off) .ps-scene.hub-short .ps-mid { bottom: 56px; }
.ps-scene.hub-short .ps-go { min-height: 44px; margin-top: 10px; }
.ps-scene.hub-tiny .ps-mali { display: none; }

/* the sheet's pages: a page whose only head item is its hidden name takes no room */
html:not(.hub-off):root:root:root body .ps-sheet .hub-pages .hub-head:not(:has(.hub-all)) { margin: 0 !important; height: 0; }
html:not(.hub-off):root:root:root body .ps-sheet .hub-pages .hub-head:has(.hub-all) { justify-content: flex-end; }
html:not(.hub-off):root:root:root body .ps-sheet .hub-pages .hub-all i { font-style: normal; }
/* small orange text on cream is --accent-text (#c22c0e by day, 5.2:1), never the brand orange (3.1:1) */
html:not(.hub-off):root:root:root body .ps-sheet .hub-pages .hub-all { color: var(--accent-text, #c22c0e); }
/* the tiles: a name, and on desktop one muted line under it */
.ps-sheet .hub-tile small { display: none; }
html:not(.hub-off) .ps-sheet .hub-tile-art img { object-fit: contain; }
@media (min-width: 761px) {
  html:not(.cz-app):root:root:root body .ps-sheet .hub-pages .hub-tile small {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; width: 100%;
    font-size: 12.5px; font-weight: 500; line-height: 1.45; color: var(--muted); }
  html:not(.cz-app) body main.hm.ap-page > .ps-sheet { margin-bottom: 8px; }
}

/* the job strip, now under the sheet: centred, no reveal delay */
html:not(.hub-off) body main.hm.ap-page > .lj.ps-lj { margin: 22px auto 0; }
@media (min-width: 761px) { html:not(.cz-app) body main.hm.ap-page > .lj.ps-lj { max-width: 760px; margin: 34px auto 10px; } }

/* phones: ui-kit.css hides every child of main.ap-page that isn't .ap (the
   old marketing sections); the scene, its sheet and the job strip show */
@media (max-width: 700px) {
  html body main.ap-page > :is(.hub-scene, .hub-sheet) { display: block !important; }
  html body main.ap-page > .lj.ps-lj { display: grid !important; margin-top: 0; }
  /* the two bottom-corner stickers would sit on the H1 and the button */
  .ps-scene .hub-sky > .hub-f:nth-of-type(n+7) { display: none; }
  html:not(.hub-off) body .ps-scene .hub-tag { max-width: 24ch; }
}

/* Health, signed-out visitors only (2026-11-22, phase 3): malitools/health/index.html
   sets html.hl-in (a Supabase session or Health set up on this device) or
   html.hl-guest in its head, before the first paint. Signed in, the scene and
   sheet never show (and a script removes them before hub.js runs); for a guest
   the page's own head (sticker chip, H1, intro) goes off screen on desktop as
   cz-app.js already does on phones: the H1 stays for search and screen readers */
html.hl-in .hl-page > :is(.ps-scene, .ps-sheet) { display: none !important; }
html.hl-guest:not(.cz-app) .hl-page > .app-head { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.hub-off) body .hl-page > .ps-sheet { margin-bottom: 20px; }
