/* Spacing: gif-to-navbar = 1.5 × gif-to-title; button-to-subtitle = gif-to-title */
.w3s-hero {
  --w3s-hero-gap-gif-title: 24px;
  position: relative;
  min-height: 729px; /* 10% less than 810 */
  display: block;
  overflow: visible; /* allow ::after band to extend into section 2 */
  padding-top: 0;
}

.w3s-hero__brand-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding-top: calc(1.5 * var(--w3s-hero-gap-gif-title));
  z-index: 10;
  pointer-events: none;
}

.w3s-hero__brand-overlay .w3s-brand__hero {
  pointer-events: auto;
  isolation: isolate;
}

.w3s-hero__panel {
  position: relative;
  min-height: inherit;
  max-height: 729px;
  border: none;
  border-bottom-left-radius: 64px;
  border-bottom-right-radius: 64px;
  overflow: hidden;
  /* Mask anti-aliased seam at rounded bottom edges (no visible stroke) */
  box-shadow: inset 0 0 0 1px var(--w3s-bg, #020617);
}

/* Full-width blur band: height ~gif, 50% (solid) aligned to Hero/Section 2 edge */
.w3s-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: clamp(560px, 76vh, 840px);
  transform: translateY(50%);
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(2, 6, 23, 0.5) 35%,
    var(--w3s-bg, #020617) 50%,
    rgba(2, 6, 23, 0.5) 65%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 20;
}

.w3s-hero__background {
  position: absolute;
  inset: 0;
  border-bottom-left-radius: 64px;
  border-bottom-right-radius: 64px;
  pointer-events: none;
}

.w3s-hero__background::before {
  content: "";
  position: absolute;
  inset: 0;
  border-bottom-left-radius: 64px;
  border-bottom-right-radius: 64px;
  background: linear-gradient(
    to bottom,
    #050816 0%,
    #050816 20%,
    #39d091 75%,
    #ffffff 100%
  );
}

.w3s-hero__background::after {
  content: "";
  position: absolute;
  inset: 0;
  border-bottom-left-radius: 64px;
  border-bottom-right-radius: 64px;
  background:
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 85%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 85%,
    rgba(0, 0, 0, 0) 100%
  );
}

.w3s-hero__matrix {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.w3s-hero__content {
  position: relative;
  z-index: 2;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: calc(1.5 * var(--w3s-hero-gap-gif-title));
  padding-bottom: 160px;
  gap: var(--w3s-hero-gap-gif-title);
}

/* Gif + title + subtitle grouped; pushed down so not too close to navbar */
.w3s-hero__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--w3s-hero-gap-gif-title);
  margin-top: clamp(4rem, 10vw, 7rem);
}

.w3s-hero__brand {
  display: flex;
  justify-content: center;
}

.w3s-hero__brand-gif {
  display: flex;
  justify-content: center;
}

.w3s-hero__brand-gif img {
  max-width: min(720px, 85vw);
  height: auto;
  display: block;
}

.w3s-hero__brand-spacer {
  height: clamp(3rem, 9vw, 6rem);
}

.w3s-hero__title {
  font-family: "W3S-TitleV2", system-ui, sans-serif;
  font-size: var(--fs-h1);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  text-align: center;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #ffffff 30%,
    #d6f7eb 36%,
    #39d091 50%,
    #d6f7eb 64%,
    #ffffff 70%,
    #ffffff 100%
  );
  background-size: 300% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: w3s-hero-title-gradient 6s linear infinite;
}

.w3s-hero__subtitle {
  max-width: 640px;
  font-family: "W3S-BodyV2", system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  text-align: center;
  color: rgba(226, 232, 240, 0.9);
}

/* CTA: hidden until 1.5s after hero in view, then fade-in; glow starts bright and settles to idle */
.w3s-hero__cta {
  margin-top: 0; /* button-to-subtitle = gap = gif-to-title */
  opacity: 0;
  transform: translateY(24px);
  /* Bright initial glow, animates to idle when --revealed */
  filter: drop-shadow(0 0 32px rgba(57, 208, 145, 0.85))
    drop-shadow(0 0 64px rgba(57, 208, 145, 0.5))
    drop-shadow(0 0 96px rgba(57, 208, 145, 0.3));
  transition:
    opacity 0.5s ease-out,
    transform 0.5s ease-out,
    filter 1s ease-out 0.3s;
}

.w3s-hero__cta--revealed {
  opacity: 1;
  transform: translateY(0);
  /* Idle glow */
  filter: drop-shadow(0 0 20px rgba(57, 208, 145, 0.5))
    drop-shadow(0 0 40px rgba(57, 208, 145, 0.25));
}

@keyframes w3s-hero-title-gradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@media (max-width: 700px) {
  .w3s-hero {
    min-height: 81vh;
  }

  .w3s-hero__panel {
    min-height: 81vh;
  }

  .w3s-hero__content {
    padding-top: calc(1.5 * var(--w3s-hero-gap-gif-title));
    padding-bottom: 80px;
    gap: var(--w3s-hero-gap-gif-title);
  }

  /* Navbar → gif offset on mobile: 1.5× larger than previous (very low) */
  .w3s-hero__head {
    margin-top: calc(var(--w3s-hero-gap-gif-title) * 6);
  }

  .w3s-hero__brand-gif img {
    max-width: 96vw;
  }

  /* Mobile: 1.5x space title↔subtitle and subtitle↔CTA */
  .w3s-hero__subtitle {
    margin-top: calc(var(--w3s-hero-gap-gif-title) * 1.5);
  }

  .w3s-hero__cta {
    margin-top: calc(var(--w3s-hero-gap-gif-title) * 1.5);
  }
}

