/* Cinematic assistant hero. The character and fog are separate image layers so
   pointer motion can give them different depth without a continuous WebGL loop. */
@font-face {
  font-family: "Space Mono";
  src: url("/assets/font/space-mono/space-mono-400-normal.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.hero-cinematic .hero-robot-scene {
  overflow: hidden;
  background:
    radial-gradient(ellipse 38% 45% at 78% 72%, #19391a 0%, transparent 80%),
    #060b09;
}

.hero-cinematic .hero-robot-scene::after {
  z-index: 4;
  background:
    linear-gradient(90deg, #060b09 0%, #060b09f2 25%, #060b0985 45%, transparent 72%),
    linear-gradient(0deg, #060b0955, transparent 23%);
}

.hero-robot-fog {
  position: absolute;
  width: 116%;
  height: 84%;
  left: -8%;
  bottom: -11%;
  /* Half-size source: the layers are blurred 3–9px, so detail is never visible. */
  background: url("/assets/images/hero-assistant-fog-900.webp") center bottom / 100% 100% no-repeat;
  pointer-events: none;
  will-change: transform;
}
.hero-robot-fog--back {
  z-index: 0;
  opacity: .9;
  filter: blur(3px);
}
.hero-robot-fog--front {
  z-index: 2;
  bottom: -23%;
  opacity: .42;
  filter: blur(9px);
}

.hero-robot-stage {
  position: absolute;
  z-index: 1;
  top: clamp(118px, 14vh, 160px);
  left: 56%;
  width: min(38.7vw, 576px);
  aspect-ratio: 1122 / 1402;
  pointer-events: none;
  filter: drop-shadow(-26px 26px 32px #0009);
}
.hero-robot-assembly {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.hero-robot-body,
.hero-robot-head {
  position: absolute;
  inset: 0;
}
.hero-robot-body { clip-path: polygon(0 33%, 100% 33%, 100% 100%, 0 100%); }
.hero-robot-head {
  clip-path: polygon(0 0, 100% 0, 100% 38%, 0 38%);
}
.hero-robot-eye {
  position: absolute;
  left: 40.7%;
  top: 3.9%;
  width: 3.7%;
  height: .7%;
  border-radius: 2px;
  background: linear-gradient(#111713, #41493d);
  box-shadow: 0 1px 0 #c7d3bd55, inset 0 1px 2px #000;
  transform: rotate(-5deg) skewX(-24deg);
}
.hero-robot-eye--right {
  left: 59.5%;
  top: 3.15%;
}
.hero-robot-eye::before {
  content: "";
  position: absolute;
  inset: -140% -32%;
  background: radial-gradient(ellipse, #b7ef6850, #a8dc5920 40%, transparent 72%);
  pointer-events: none;
}
.hero-robot-eye::after {
  content: "";
  position: absolute;
  inset: 22% 10% 24%;
  border-radius: 1px;
  background: linear-gradient(#e5ffc2, #b9ed83 42%, #74a849);
  box-shadow: inset 0 -1px 1px #3c5f2d, 0 0 3px #b9ed8380;
}
.hero-robot-body img,
.hero-robot-head img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  user-select: none;
}
.hero-robot-fan {
  position: absolute;
  left: 33.15%;
  top: 43.51%;
  width: 21.4%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #080b09;
  /* Normalize the photographed opening before rotating the blades. */
  transform: scaleY(1.042);
  transform-origin: top center;
}
.hero-robot-fan-rotor {
  position: absolute;
  inset: 0;
  transform-origin: center;
  animation: hero-robot-fan-spin 2.8s linear infinite;
  will-change: transform;
}
.hero-robot-fan img {
  position: absolute;
  left: -154.91%;
  top: -244.05%;
  display: block;
  width: 467.29%;
  height: 560.91%;
  max-width: none;
  object-fit: fill;
}
.hero-robot-status-light {
  position: absolute;
  left: 70.5%;
  top: 64.75%;
  width: 7.15%;
  height: 1.35%;
  border-radius: 999px;
  background: linear-gradient(#7d9450, #4c652e 45%, #354b24);
  box-shadow: inset 0 1px 2px #17231380;
  transform: rotate(-2deg);
}
.hero-robot-status-light::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 16%;
  left: 12%;
  width: 76%;
  height: 14%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #e9ffc65c, transparent);
}
.hero-robot-status-light::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(#d5ee83, #b9df59 48%, #99be41);
  box-shadow: inset 0 1px 1px #eaffb75c, 0 0 8px #b9ed8366;
  animation: hero-status-blink 4s ease-in-out infinite;
}
.hero-robot-scene.is-paused .hero-robot-fan-rotor,
.hero-robot-scene.is-paused .hero-robot-status-light::after,
.hero-robot-scene.is-paused .hero-robot-screen::after,
.hero-robot-scene.is-paused .hero-robot-screen-title::after { animation-play-state: paused; }

.hero-robot-screen {
  position: absolute;
  left: 29.5%;
  top: 9.2%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 45%;
  height: 20.8%;
  padding-inline: clamp(10px, 1.25vw, 18px);
  overflow: hidden;
  color: #9fbd8e;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  text-shadow: 0 0 6px #b9ed8340;
  transform: rotate(-1deg);
}
.hero-robot-screen::before,
.hero-robot-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-robot-screen::before {
  background: repeating-linear-gradient(0deg, transparent 0 4px, #b9ed8308 4px 5px);
  opacity: .7;
}
.hero-robot-screen::after {
  inset: -50%;
  background: linear-gradient(110deg, transparent 42%, #d9ffbd12 49%, transparent 57%);
  transform: translateX(-34%);
  animation: hero-screen-glance 11s ease-in-out infinite;
}
.hero-robot-screen-title {
  display: block;
  max-width: 92%;
  min-height: 1.3em;
  color: inherit;
  font-size: clamp(13px, 1.35vw, 20px);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.4;
  white-space: normal;
}
.hero-robot-screen-title::after {
  content: "";
  display: inline-block;
  width: .45em;
  height: 1em;
  margin-left: .24em;
  border-right: 2px solid #b9ed83;
  vertical-align: -.15em;
  animation: hero-screen-caret 1s steps(1) infinite;
}

@keyframes hero-screen-caret { 50% { opacity: 0; } }
@keyframes hero-screen-glance { 0%, 63%, 100% { transform: translateX(-34%); } 80% { transform: translateX(34%); } }
@keyframes hero-robot-fan-spin { to { transform: rotate(360deg); } }
@keyframes hero-status-blink {
  0%, 40%, 85%, 100% { opacity: 1; }
  50%, 75% { opacity: .4; }
}

@media (max-width: 1023px) and (min-width: 768px) {
  .hero-robot-stage { left: 53%; width: 53vw; }
  .hero-robot-screen-title { font-size: clamp(12px, 1.5vw, 17px); }
}

@media (max-width: 767px) {
  .studio-hero.hero-cinematic {
    min-height: 0;
    background: #060b09;
  }
  .hero-cinematic .hero-content {
    flex: none;
    padding-bottom: 20px;
  }
  .hero-cinematic .hero-robot-scene {
    position: relative;
    inset: auto;
    z-index: 0;
    order: 1;
    height: clamp(300px, 95vw, 390px);
  }
  .hero-cinematic .hero-robot-scene::after {
    background: linear-gradient(180deg, transparent 82%, #060b09 100%);
  }
  .hero-robot-stage {
    top: 0;
    left: 50%;
    width: min(110vw, 430px);
    transform: translateX(-50%);
  }
  .hero-robot-fog {
    width: 200%;
    height: 80%;
    left: -50%;
    bottom: -5%;
  }
  .hero-robot-fog--front {
    bottom: -17%;
    opacity: .65;
  }
  .hero-robot-screen-title { font-size: 11px; }
  .hero-cinematic .hero-foot {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    padding-block: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-robot-fan-rotor,
  .hero-robot-status-light::after,
  .hero-robot-screen::after,
  .hero-robot-screen-title::after { animation: none; }
  .hero-robot-screen-title::after { display: none; }
}

@media print { .hero-robot-scene { display: none; } }
