/* Osi hero: the live 3D mascot beside the homepage headline (hero only).
   Poster (img/mascot/osi-hero.*) is a still of the web model with its contact shadow baked in. It stays until
   /js/mascot/* draws the first frame, and is the final image for reduced motion, no WebGL, no JS. No rings, no orbit dots. */

/* ---------- desktop: text left, mascot right ---------- */
@media (min-width: 981px) {
  main section.hero { align-items: stretch; text-align: left; }
  .hero .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr);
    grid-template-areas: "label mascot" "title mascot" "lead mascot" "cta mascot";
    grid-template-rows: auto auto auto 1fr;
    column-gap: 56px;
    align-content: center;
  }
  .hero .hb { grid-area: label; justify-self: start; margin: 0 0 20px; }
  .hero h1 { grid-area: title; text-align: left; margin: 0 0 22px; max-width: none;
             font-size: clamp(2.8rem, 4.4vw, 3.9rem); line-height: 1.07; }
  .hero h1 .rot-stage { text-align: left; }
  .hero p { grid-area: lead; text-align: left; margin: 0 0 34px; max-width: 34rem; }
  .hero .hc { grid-area: cta; justify-content: flex-start; align-self: start; margin: 0; }
  .hero-mascot { grid-area: mascot; align-self: center; }
}

/* ---------- the mascot stage ---------- */
.hero-mascot {
  position: relative;
  margin: 0;
  min-height: 500px;
  isolation: isolate;
}
/* very faint cool disc so the warm red sits on the white/blue page */
.hero-mascot .hm-glow {
  position: absolute; z-index: -2;
  left: 50%; top: 50%;
  width: 96%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, #EEF4FF 0%, rgba(235, 241, 248, .85) 50%, rgba(235, 241, 248, .35) 80%, rgba(255, 255, 255, 0) 100%);
}
/* poster: same box and framing as the live canvas (contain at the model's fit ratio), so the swap does not jump */
.hero-mascot .hm-figure { position: absolute; inset: 0; z-index: 1; display: block; margin: 0; }
.hero-mascot .hm-figure img {
  display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%;
  animation: hm-breathe 6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes hm-breathe {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-4px) scale(1.012, .988); }
}
@media (prefers-reduced-motion: reduce) { .hero-mascot .hm-figure img { animation: none; } }

/* ---------- live 3D canvas; poster stays until the first frame ---------- */
.hero-mascot .hm-canvas {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity .6s ease; touch-action: pan-y;
}
.hero-mascot .hm-figure { transition: opacity .6s ease; }
.hero-mascot.hm-live .hm-canvas { opacity: 1; }
.hero-mascot.hm-live .hm-figure { opacity: 0; }

/* ---------- tablet / mobile: mascot above the label, rest stays centered ---------- */
@media (max-width: 980px) {
  .hero .container { display: flex; flex-direction: column; align-items: center; }
  .hero-mascot { order: -1; min-height: 0; height: 190px; width: 100%; margin: -40px 0 14px; }
  .hero-mascot .hm-glow { width: 200px; }
}

/* ---------- headline lines ---------- */
/* Headline is always 3 lines: "I make AI" / phrase / "inside your business." (phrase has its own line, see the <br> in the h1).
   On the narrowest phones shrink the type just enough that "inside your business." (~9.8em) never wraps to a 4th line. */
@media (max-width: 389px) { .hero h1 { font-size: min(32.8px, calc((100vw - 40px) / 10.2)); } }
