/* The homepage's desktop hero (2026-10-28): a poster, after the user's
   references (a giant word with characters in front of it, small labels
   round the edge, a turning sticker, a line and two pill buttons). It
   restyles hub.css's .hub-home scene on desktop only (no cz-app, over 760px):
   the phone's big word goes, the scene is a column of labels, the stage (word + Mali's
   cast, sized with container units) and the greeting, H1 line and buttons.
   Phones never show .hd-*. Loaded after hub.css. Motion: transform only. */
.hd-top, .hd-stage, .hd-cta, .hd-side { display: none; }

@media (min-width: 761px) {
  /* the scene: nearly a screen tall, Today peeking under it */
  html:not(.cz-app):not(.hub-off) .hub-home {
    --hd-h: clamp(560px, calc(100svh - var(--hub-up, 70px) - 96px), 800px);
    --hd-ink: #111111; --hd-face: #f3eee3; --hd-ext: #ff4b2b; --hd-z: #ff4b2b; --hd-zext: #8a2412; --hd-line: rgba(243, 238, 227, .72);
    display: flex !important; flex-direction: column; align-items: center; box-sizing: border-box;
    height: calc(var(--hub-up, 70px) + var(--hd-h)) !important; padding: calc(var(--hub-up, 70px) + 20px) 0 74px;
  }
  /* light theme: the scene is orange, so the extrusion is ink and the Z yellow */
  html:not(.cz-app):not(.hub-off):not([data-theme="dark"]) .hub-home { --hd-ext: #111111; --hd-z: #ffd23f; --hd-zext: #111111; --hd-line: rgba(255, 248, 239, .9); }
  /* main has no padding here, so the scene's negative top margin (it slides
     under the header) would collapse through main, and hub.js's lift would
     measure its own result and settle on a few px, leaving a band of page
     colour behind the header: flow-root stops the collapse */
  html:not(.cz-app):not(.hub-off) main.hm-home { display: flow-root; }
  html:not(.cz-app) .hub-home .hub-word { display: none; }
  /* the stickers round the poster's edge (the inline places are the phone's) */
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(1) { --x: 4% !important; --y: 6% !important; }
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(2) { --x: 13% !important; --y: 26% !important; }
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(3) { --x: 84% !important; --y: 52% !important; }
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(4) { --x: 79% !important; --y: 4% !important; }
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(5) { --x: 3% !important; --y: 44% !important; }
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(6) { --x: 6% !important; --y: 70% !important; }
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(7) { --x: 88% !important; --y: 30% !important; }
  html:not(.cz-app) .hub-home .hub-sky > .hub-f:nth-child(8) { --x: 90% !important; --y: 72% !important; }
  html:not(.cz-app) .hub-home::after { bottom: 34%; width: 760px; height: 520px; margin-left: -380px; }

  /* 01 MaliTools · 02 MaliWikis · 03 MaliGames, spread over the word */
  html:not(.cz-app) .hub-home .hd-top { position: relative; z-index: 3; display: flex; justify-content: space-between; width: min(1180px, calc(100vw - 96px)); }
  .hd-top a { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 0; border-bottom: 1px solid transparent;
    font: 700 12.5px/1 var(--sp-display, "Chakra Petch", system-ui, sans-serif); letter-spacing: .16em; text-transform: uppercase;
    color: var(--hd-line); text-decoration: none; transition: border-color .2s, color .2s; }
  .hd-top a b { font-weight: 700; color: var(--hd-z); }
  .hd-top a:hover { color: var(--hd-face); border-bottom-color: currentColor; }

  /* the stage: the word, and the cast standing in front of it */
  html:not(.cz-app) .hub-home .hd-stage { position: relative; z-index: 1; display: block; flex: 1; width: 100%; min-height: 0; margin-top: 8px; container-type: size; }
  .hd-word { position: absolute; left: 50%; top: 2cqh; z-index: 0; margin: 0; transform: translateX(-50%); white-space: nowrap;
    font: 700 min(20cqw, 64cqh)/.84 var(--sp-display, "Chakra Petch", system-ui, sans-serif); letter-spacing: -.04em;
    color: var(--hd-face); text-shadow: .03em .045em 0 var(--hd-ext); pointer-events: none; }
  .hd-word span { display: inline-block; animation: hdRise .42s cubic-bezier(.22, 1, .36, 1) backwards; animation-delay: calc(var(--i) * 45ms); }
  .hd-word .z { color: var(--hd-z); text-shadow: .03em .045em 0 var(--hd-zext); }
  @keyframes hdRise { from { transform: translateY(16%); } }

  /* Mali in the middle, waving, the biggest; Bills, Trips, MERPY and
     MaliGames beside her, each a link with its name on hover */
  .hd-cast { position: absolute; inset: 0; z-index: 1; }
  .hd-mali { position: absolute; bottom: 0; left: calc(50% + var(--x) * 1cqw); width: calc(var(--h) * 1cqh); height: calc(var(--h) * 1cqh);
    transform: translateX(-50%); color: var(--hd-face); text-decoration: none; }
  .hd-mali img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transform-origin: 50% 100%;
    animation: hdBob var(--t, 5s) ease-in-out var(--dl, 0s) infinite; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .28)); }
  .hd-lead img { animation: hubWave 4.6s ease-in-out infinite; }
  a.hd-mali span { position: absolute; left: 50%; top: 2%; padding: 5px 12px; border-radius: 999px; background: var(--hd-face); color: var(--hd-ink);
    font: 700 13px/1 var(--sp-display, "Chakra Petch", system-ui, sans-serif); letter-spacing: .04em; white-space: nowrap;
    box-shadow: 0 3px 0 var(--ink-sh, var(--hd-ink)); opacity: 0; transform: translate(-50%, 8px); transition: opacity .18s, transform .18s; pointer-events: none; }
  a.hd-mali:is(:hover, :focus-visible) span { opacity: 1; transform: translate(-50%, 0); }
  a.hd-mali:is(:hover, :focus-visible) img { animation-play-state: paused; transform: translateY(-4%) scale(1.04); transition: transform .2s; }
  a.hd-mali:focus-visible { outline: none; }
  @keyframes hdBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5%); } }

  /* the turning "free" sticker on the word's shoulder */
  .hd-badge { position: absolute; left: calc(50% + min(20cqw, 64cqh) * 1.85); top: 0; z-index: 2; display: grid; place-items: center;
    width: clamp(92px, 20cqh, 132px); aspect-ratio: 1; transform: translateX(-50%) rotate(-10deg); color: var(--hd-ink); text-decoration: none; }
  .hd-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: hubSpin 16s linear infinite; }
  .hd-badge path { fill: #ffd23f; stroke: var(--hd-ink); stroke-width: 2.5px; stroke-linejoin: round; filter: drop-shadow(0 4px 0 var(--ink-sh, #111111)); }
  .hd-badge span { position: relative; display: grid; justify-items: center; line-height: 1; }
  .hd-badge b { font: 700 clamp(24px, 5.4cqh, 34px)/1 var(--sp-display, "Chakra Petch", system-ui, sans-serif); }
  .hd-badge small { margin-top: 3px; font-size: clamp(11px, 2.2cqh, 13px); font-weight: 800; }
  .hd-badge:hover svg { animation-duration: 4s; }

  /* under the stage: the greeting on one line, the H1 line, the buttons */
  /* :is() lifts these over hub.css's .hub-short / .hub-tiny rules */
  html:not(.cz-app) .hub-home:is(*, .hub-short, .hub-tiny) .hub-mid { position: relative; inset: auto; bottom: auto; z-index: 2; margin-top: 14px; padding: 0 24px; animation: none; }
  html:not(.cz-app) .hub-home .hub-hi { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
  html:not(.cz-app) .hub-home .hub-hi small { font-size: 15px; }
  html:not(.cz-app) .hub-home:is(*, .hub-short, .hub-tiny) .hub-hi b { font-size: 26px; text-shadow: none; }
  html:not(.cz-app) .hub-home:is(*, .hub-short, .hub-tiny) .hub-tag { margin-top: 6px; font-size: 17px; }
  html:not(.cz-app) .hub-home .hd-cta { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
  .hd-btn { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 26px; border-radius: 999px; border: 2px solid var(--hd-face);
    color: var(--hd-face); font-size: 16px; font-weight: 800; text-decoration: none; transition: transform .16s, background-color .2s, color .2s; }
  .hd-btn.on { background: var(--hd-face); color: var(--hd-ink); box-shadow: 0 4px 0 var(--ink-sh, var(--hd-ink)); }
  .hd-btn i { font-style: normal; font-size: 13px; }
  .hd-btn:hover { transform: translateY(-2px); }
  .hd-btn:not(.on):hover { background: rgba(243, 238, 227, .12); }

  /* the two small lines at the bottom corners */
  html:not(.cz-app) .hub-home .hd-side { position: absolute; bottom: 104px; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 0;
    font: 700 12px/1.3 var(--sp-display, "Chakra Petch", system-ui, sans-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--hd-line); }
  .hd-side.l { left: max(48px, calc(50vw - 590px)); }
  .hd-side.r { right: max(48px, calc(50vw - 590px)); }
  .hd-side i { width: 8px; height: 8px; border-radius: 50%; background: var(--hd-z); }

  /* a short window: no corner lines, a tighter column */
  @media (max-height: 760px) {
    html:not(.cz-app) .hub-home .hd-side { display: none; }
    html:not(.cz-app) .hub-home .hd-cta { margin-top: 12px; }
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  html:not(.cz-app) .hub-home .hd-side { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-word span, .hd-mali img, .hd-badge svg { animation: none !important; }
}

/* the five MaliTools parts under the picker (2026-11-14); phones hide the picker and show .ph-cats instead */
.pk-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px auto 0; padding: 0 16px; }
.pk-cat { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; box-sizing: border-box; padding: 4px 16px 4px 6px; border-radius: 999px;
  border: 1px solid var(--line, rgba(127, 127, 127, .2)); background: var(--surface); color: var(--text); text-decoration: none;
  font-size: 14px; font-weight: 800; white-space: nowrap; transition: transform .15s; }
.pk-cat img { width: 34px; height: 34px; }
.pk-cat:hover { transform: translateY(-2px); }
.pk-cat:focus-visible { outline: 2px solid var(--accent, #ff4b2b); outline-offset: 2px; }

