.space-ev-home-hero {
  --hero-inset: 76px;
  --hero-art-width: clamp(440px, 105vw, 1160px);
  --hero-scroll-distance: clamp(300px, 65svh, 540px);
  margin-inline: -16px;
  color: #1f1d1d;
  text-align: center;
}

.space-ev-has-scroll-hero #page,
.space-ev-has-scroll-hero main > .container > .wrapper {
  overflow: clip;
}

#header.space-ev-hero-nav-hidden {
  transform: translateY(-101%);
  pointer-events: none;
  visibility: hidden;
  transition: transform .4s ease, visibility 0s .4s;
}

.space-ev-home-hero[data-scroll-motion]::after {
  display: block;
  height: var(--hero-scroll-distance);
  content: "";
}

.space-ev-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: clamp(22px, 5svh, 48px);
  padding: clamp(108px, 17svh, 154px) 16px clamp(44px, 9svh, 84px);
}

.space-ev-hero-panel {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - var(--hero-inset));
  overflow: hidden;
  background: radial-gradient(ellipse at center 76%, #edf5fd, transparent 63%), #fff;
}

[data-scroll-motion] .space-ev-hero-panel {
  position: sticky;
  top: 0;
  min-height: 100svh;
}

.space-ev-hero-reveal {
  display: none;
  position: absolute;
  z-index: 1;
  inset: 0;
  background: #1774ce url("/_assets/carbo.tech/wp-content/themes/carbo/images/lottie/hero-type-1/bg.svg") center / cover no-repeat;
  color: #fff;
  pointer-events: none;
}

[data-scroll-motion] .space-ev-hero-reveal {
  display: grid;
  animation: space-ev-hero-scroll-reveal 1s cubic-bezier(.333333, .666667, .666667, 1) both paused;
}

.space-ev-hero-copy {
  font-size: clamp(39px, min(5.1vw, 8.8svh), 72px);
  line-height: 1.06;
}

.space-ev-hero-heading {
  max-width: 1120px;
  margin: 0 auto;
  font-family: "Neue Haas Grotesk Display Pro", sans-serif;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  letter-spacing: inherit;
  text-wrap: balance;
}

.space-ev-hero-vehicles {
  display: grid;
  padding-block: .06em;
  margin-top: .07em;
  overflow: hidden;
  color: var(--space-ev-accent-ink);
  font-weight: 500;
}

.space-ev-hero-reveal .space-ev-hero-vehicles {
  color: #d5edff;
}

.space-ev-hero-vehicles span {
  grid-area: 1 / 1;
  opacity: 0;
}

.space-ev-hero-vehicles span:first-child {
  opacity: 1;
}

.space-ev-hero-connectors,
.space-ev-hero-reveal::after {
  width: var(--hero-art-width);
  aspect-ratio: 1440 / 400;
}

.space-ev-hero-reveal::after {
  content: "";
}

.space-ev-hero-connectors {
  position: relative;
  z-index: 2;
  isolation: isolate;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.space-ev-hero-connectors::before {
  position: absolute;
  z-index: -1;
  inset: 62% 18% 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(39 77 116 / .22), transparent 68%);
  filter: blur(12px);
  content: "";
}

.space-ev-hero-connectors::after {
  position: absolute;
  inset: 38% 51% 38% 41%;
  background: radial-gradient(ellipse, rgb(102 198 255 / .75), transparent 68%);
  opacity: 0;
  content: "";
}

.space-ev-hero-connectors img {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
  translate: 0 -50%;
}

.space-ev-hero-plug {
  --plug-start: -10%;
  --plug-settle: .16%;
}

.space-ev-hero-socket {
  --plug-start: 10%;
  --plug-settle: -.16%;
}

.space-ev-hero-connectors .space-ev-hero-signal {
  opacity: 0;
  filter: brightness(1.3) drop-shadow(0 0 4px #90dbff);
}

[data-scroll-motion] .space-ev-hero-connectors {
  animation: space-ev-hero-scroll-rise 1s linear both paused;
}

[data-scroll-motion] :is(.space-ev-hero-plug, .space-ev-hero-socket) {
  animation: space-ev-hero-scroll-mate 1s linear both paused;
}

[data-scroll-motion] .space-ev-hero-connectors::after {
  animation: space-ev-hero-scroll-contact 1s linear both paused;
}

[data-scroll-motion] .space-ev-hero-signal {
  animation: space-ev-hero-scroll-pulse 1s linear both paused;
}

@media (min-width: 768px) {
  .space-ev-home-hero {
    margin-inline: -32px;
  }
}

@media (min-width: 1025px) and (orientation: landscape) {
  .space-ev-home-hero {
    --hero-inset: 120px;
    --hero-scroll-distance: 2000px;
  }
}

@media (min-width: 768px) and (max-height: 820px) {
  .space-ev-home-hero {
    --hero-art-width: min(105vw, 150svh, 1160px);
  }

  .space-ev-hero-layout {
    padding-top: clamp(52px, 12svh, 104px);
    padding-bottom: clamp(28px, 6svh, 52px);
  }
}

@media (max-width: 767px) {
  .space-ev-home-hero {
    --hero-art-width: clamp(440px, 114vw, 850px);
  }

  .space-ev-hero-layout {
    gap: clamp(16px, 5svh, 38px);
    padding-top: clamp(78px, 13svh, 122px);
  }

  .space-ev-hero-copy {
    font-size: clamp(34px, 9.5vw, 47px);
  }

  .space-ev-hero-vehicles {
    font-size: .91em;
  }
}

@media (max-width: 1024px), (orientation: portrait) {
  [data-scroll-motion] .space-ev-hero-panel {
    min-height: 100lvh;
  }

  .space-ev-hero-connectors {
    mask-image: none;
  }

  .space-ev-hero-connectors::before {
    filter: none;
  }

  .space-ev-hero-connectors .space-ev-hero-signal {
    filter: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html:not(.overflow-hidden) .space-ev-hero-vehicles span {
    animation: space-ev-hero-vehicle 12s linear infinite;
  }

  html:not(.overflow-hidden) .space-ev-hero-vehicles span:nth-child(2) {
    animation-delay: -8s;
  }

  html:not(.overflow-hidden) .space-ev-hero-vehicles span:nth-child(3) {
    animation-delay: -4s;
  }
}

@keyframes space-ev-hero-vehicle {
  0%, 26% { opacity: 1; transform: none; }
  32%, 33% { opacity: 0; transform: translateY(-45%); }
  34%, 94% { opacity: 0; transform: translateY(55%); }
  100% { opacity: 1; transform: none; }
}

@keyframes space-ev-hero-scroll-reveal {
  0% { clip-path: circle(0% at 50% 100%); }
  100% { clip-path: circle(100% at 50% 50%); }
}

@keyframes space-ev-hero-scroll-rise {
  from { transform: translateY(clamp(16px, 4svh, 38px)) rotate(-4deg) scale(.86); }
  67%, 100% { transform: none; }
}

@keyframes space-ev-hero-scroll-mate {
  0%, 9% {
    transform: translateX(var(--plug-start));
    animation-timing-function: cubic-bezier(.37, 0, .24, 1);
  }
  56% { transform: translateX(var(--plug-settle)); }
  62%, 100% { transform: translateX(0); }
}

@keyframes space-ev-hero-scroll-contact {
  0%, 52%, 69%, 100% { opacity: 0; }
  58% { opacity: .76; }
}

@keyframes space-ev-hero-scroll-pulse {
  0%, 60% { opacity: 0; clip-path: inset(0 27% 0 69%); }
  66% { opacity: 1; }
  83% { opacity: .92; }
  90%, 100% { opacity: 0; clip-path: inset(0 0 0 96%); }
}
