/* ==========================================================================
   Interactive character hero, styled for mirzaasadbaig.com
   Three columns: headline | character | intro + buttons.
   Stays side by side down to 768px wide; stacks only on phones.
   Fonts and colours come from the site: --disp (Bricolage Grotesque),
   --body (Space Grotesk), --mono (Space Mono), --grad, --violet, ...
   ========================================================================== */

.mab-hero {
  --nav-h: 88px;                               /* fixed site nav + breathing room */
  --say-h: 56px;                               /* room above his head for messages */
  --gap-b: clamp(14px, 3vh, 36px);             /* desk below the laptop */
  --col-gap: clamp(14px, 2.4vw, 44px);
  --stage-h: min(
    clamp(360px, calc(100svh - var(--nav-h) - var(--say-h) - var(--gap-b)), 880px),
    44vw
  );
  --stage-w: calc(var(--stage-h) * .81818);    /* 720 / 880 source frames */

  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stage-w) minmax(0, 1fr);
  column-gap: var(--col-gap);
  align-items: center;
  padding: calc(var(--nav-h) + var(--say-h)) var(--pad) var(--gap-b);
  overflow: clip;
  color: var(--text);
  font-family: var(--body);
}

/* ------------------------------------------------------------ text columns */
.mab-hero__side { position: relative; z-index: 3; min-width: 0; }
.mab-hero__side--left  { grid-column: 1; justify-self: start; max-width: 520px; }
.mab-hero__side--right { grid-column: 3; justify-self: end; max-width: 440px; }

.mab-hero__side .hero__badge {
  margin-bottom: 1.3rem;
  font-size: clamp(.56rem, .7vw, .7rem);
  letter-spacing: .12em;
  white-space: nowrap;
}

/* same treatment as your original hero headline */
.mab-hero__title {
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.6vw, 4.2rem);
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.mab-hero__side .hero__sub {
  margin-top: 0;
  max-width: 42ch;
  font-family: var(--body);
  font-size: clamp(.86rem, 1.05vw, 1.1rem);
  line-height: 1.6;
}
.mab-hero__side .hero__cta { justify-content: flex-start; flex-wrap: wrap; gap: .6rem; margin-top: clamp(1.1rem, 2vw, 1.8rem); }
.mab-hero__side .hero__cta .btn {
  font-family: var(--body);
  padding: clamp(.65rem, .9vw, .85rem) clamp(.95rem, 1.3vw, 1.35rem);
  font-size: clamp(.78rem, .85vw, .88rem);
  white-space: nowrap;
}
.mab-hero__side .hero__trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: .9rem 1.1rem;
  margin-top: clamp(1.2rem, 2.2vw, 2rem);
  padding-top: clamp(1rem, 1.6vw, 1.4rem);
  border-top: 1px solid var(--line);
  text-align: left;
  font-family: var(--mono);
  font-size: clamp(.58rem, .66vw, .68rem);
  line-height: 1.5;
}
.mab-hero__side .hero__trust span { display: block; margin: 0; }
.mab-hero__side .hero__trust span::after { display: none; }
.mab-hero__side .hero__trust b {
  display: block;
  font-family: var(--disp);
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
  line-height: 1.1;
  margin: 0 0 .15rem;
}

.mab-hero__call {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(1.2rem, 2vw, 2rem);
  padding: .55rem 0 .7rem;
  border: 0;
  background: none;
  font-family: var(--body);
  font-size: clamp(.8rem, .9vw, .92rem);
  line-height: 1.3;
  white-space: nowrap;
  color: var(--soft);
  cursor: pointer;
  border-radius: 8px;
  transition: color .25s ease;
}
.mab-hero__call:hover { color: var(--text); }

/* ------------------------------------------------------------------ stage */
.mab-hero__stage {
  grid-column: 2;
  align-self: end;
  position: relative;
  z-index: 2;
  width: var(--stage-w);
  height: var(--stage-h);
}
.mab-hero__poster,
.mab-hero__canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  max-width: none;
}
.mab-hero__canvas { will-change: transform; }       /* own layer: redraws don't repaint the page */

/* The source video crops his arms at its left and right edges (waving,
   pointing). Feathering the outer edges makes the arms fade out softly
   instead of ending in a hard vertical cut. */
.mab-hero__poster,
.mab-hero__canvas {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.mab-hero__poster img { width: 100%; height: 100%; display: block; }
.mab-hero:not(.is-touch) .mab-hero__stage { cursor: default; }
.mab-hero.is-touch .mab-hero__stage { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mab-hero__poster { transition: opacity .3s ease; }
.mab-hero.is-live .mab-hero__poster { opacity: 0; }

/* While the hero is on screen the site's background blobs hold still:
   animating them under a changing canvas doubles the compositing work. */
.mab-hero-active .aurora i { animation-play-state: paused; }

/* Violet stage light, brightest at neck level, fades before the nav */
.mab-hero__glow {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: -4%;
  width: 200%;
  height: 124%;
  transform: translate3d(-50%, 0, 0) scale(.96);
  background: radial-gradient(closest-side,
    rgba(240, 236, 255, .95) 0%,
    rgba(214, 202, 255, .78) 30%,
    rgba(165, 139, 255, .38) 54%,
    rgba(107, 155, 255, .1) 76%,
    rgba(107, 155, 255, 0) 100%);
  opacity: .9;
  transition: transform 1.4s cubic-bezier(.2, .7, .2, 1), opacity 1.4s ease;
  pointer-events: none;
}
.mab-hero.is-greeting .mab-hero__glow { transform: translate3d(-50%, 0, 0) scale(1.05); opacity: 1; }

/* Glass desk across the page, aligned to the desk edge in the frames */
.mab-hero__desk {
  position: absolute;
  z-index: 0;
  left: 50%;
  width: 100vw;
  top: 90.9%;
  height: calc(9.1% + var(--gap-b));
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02));
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  pointer-events: none;
}
.mab-hero__desk::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #a58bff 35%, #6b9bff 65%, transparent);
  opacity: .7;
}
.mab-hero__shadow {
  position: absolute;
  z-index: 1;
  left: 18%;
  right: 18%;
  bottom: -1.4%;
  height: 4.4%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  pointer-events: none;
}

/* Cursor indicator: three zone dots on the text's centre line, with the
   pointer tip resting on the active dot (moved by hero.js) */
.mab-cue { position: relative; flex: none; width: 58px; height: 1.3em; align-self: center; }
.mab-cue__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mab-cue__track::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 2px;
  height: 1px;
  background: var(--line-2);
}
.mab-cue__track i {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(165, 139, 255, .6);
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.mab-cue__cursor {
  position: absolute;
  left: 1px;                       /* arrow tip on the dot centre */
  top: calc(50% - 1px);
  width: 11px;
  height: 14px;
  fill: var(--text);
  stroke: var(--bg);
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(139, 108, 255, .7));
  will-change: transform;
}
.mab-hero[data-zone="left"]   [data-cue="left"],
.mab-hero[data-zone="center"] [data-cue="center"],
.mab-hero[data-zone="right"]  [data-cue="right"] {
  background: #a58bff;
  transform: scale(1.3);
  box-shadow: 0 0 10px 1px var(--glow);
}
.mab-cue__tap { display: none; }

/* ------------------------------------------ speech message (above his head) */
.mab-say {
  position: absolute;
  z-index: 4;
  bottom: calc(100% + 10px);
  left: 50%;
  margin: 0;
  padding: .6rem 1rem .65rem;
  font-family: var(--body);
  font-weight: 500;
  font-size: clamp(.82rem, 1vw, 1rem);
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text);
  background: rgba(13, 13, 19, .74);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 16px 40px -18px var(--glow);
  opacity: 0;
  transform: translate3d(-50%, 6px, 0) scale(.97);
  transform-origin: 50% 100%;
  transition: opacity .22s ease, transform .35s cubic-bezier(.16, 1, .3, 1);
  pointer-events: none;
}
.mab-say[data-side="left"]  { left: 30%; border-bottom-right-radius: 4px; }
.mab-say[data-side="right"] { left: 70%; border-bottom-left-radius: 4px; }
.mab-say[data-key^="c"]     { left: 50%; border-radius: 16px; }
.mab-say.is-on { opacity: 1; transform: translate3d(-50%, 0, 0); pointer-events: auto; }
.mab-say:empty { display: none; }

.mab-say a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.mab-say a svg { width: 11px; height: 13px; stroke: #8fa4ff; fill: none; stroke-width: 1.6; }
.mab-say a:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; border-radius: 4px; }

/* touch screens (tablets, phones): tap pulse instead of the gliding pointer */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  .mab-cue { width: 26px; }
  .mab-cue__track, .mab-cue__cursor { display: none; }
  .mab-cue__tap {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--grad);
    box-shadow: 0 0 10px var(--glow);
  }
  .mab-cue__tap::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid #a58bff;
    animation: mab-tap 2.2s ease-out infinite;
  }
}
@keyframes mab-tap {
  0%   { transform: scale(1); opacity: .9; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}

@media (max-width: 1099px) {
  .mab-hero__side .hero__badge { white-space: normal; line-height: 1.5; }
}

/* ---------------------------------------------------- phones only: stack */
@media (max-width: 767px) {
  .mab-hero {
    --nav-h: 64px;
    --gap-b: 18px;
    --stage-w: min(calc(100vw - 20px), 480px);
    --stage-h: calc(var(--stage-w) * 1.22222);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding: calc(var(--nav-h) + 26px) 0 0;
  }
  .mab-hero__side,
  .mab-hero__side--left,
  .mab-hero__side--right {
    grid-column: 1;
    justify-self: stretch;
    max-width: none;
    padding: 0 var(--pad);
    text-align: center;
  }
  .mab-hero__stage { grid-column: 1; margin-top: 76px; }
  .mab-hero__title { font-size: clamp(2.1rem, 9vw, 3rem); }
  .mab-hero__side .hero__badge { font-size: .6rem; white-space: normal; }
  .mab-hero__side .hero__sub { margin-inline: auto; font-size: .98rem; }
  .mab-hero__side .hero__cta { justify-content: center; }
  .mab-hero__side .hero__cta .btn { font-size: .88rem; padding: .85rem 1.3rem; }
  .mab-hero__side .hero__trust { text-align: center; font-size: .66rem; }
  .mab-hero__side .hero__trust b { font-size: 1.35rem; }
  .mab-hero__side--right { padding-top: calc(var(--gap-b) + 2.4rem); padding-bottom: 3rem; }
  .mab-hero__call { margin-top: 1.1rem; gap: .6rem; font-size: .9rem; }
  .mab-say, .mab-say[data-side] { left: 50%; border-radius: 16px; }
}
