.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 140;
  height: 2px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.05);
}

.scroll-progress span {
  display: block;
  width: var(--jd-home-scroll-progress);
  height: 100%;
  background: linear-gradient(90deg, rgba(11, 13, 15, 0.95), var(--orange-700), var(--orange-500));
  box-shadow: 0 0 16px rgba(255, 107, 26, 0.24);
}

body[data-jadey-template="homepage"] .hero,
body[data-jadey-surface="sphere-background"] .hero {
  position: relative;
  overflow: hidden;
  isolation: auto;
  background: var(--jd-home-hero-background);
  background-attachment: fixed;
}

body[data-jadey-template="homepage"] .hero::before,
body[data-jadey-surface="sphere-background"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 78px 78px;
  opacity: clamp(0.2, calc(var(--jd-home-hero-overlay-opacity-max) - (var(--jd-home-scroll-value) * 0.00022)), var(--jd-home-hero-overlay-opacity-max));
  transform: translate3d(0, calc(var(--jd-home-scroll-value) * -0.075px), 0);
  mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 68%);
}

body[data-jadey-template="homepage"] .hero::after,
body[data-jadey-surface="sphere-background"] .hero::after {
  content: none;
}

body[data-jadey-template="homepage"] .hero .section-shell,
body[data-jadey-surface="sphere-background"] .hero .section-shell {
  position: relative;
  z-index: 2;
}

body[data-jadey-surface="sphere-background"] .hero .section-shell {
  width: min(50%, var(--container));
  max-width: var(--container);
  margin-inline: auto;
}

body[data-jadey-surface="sphere-background"] .hero .hero-shell,
body[data-jadey-surface="sphere-background"] .hero .subpage-hero-shell,
body[data-jadey-surface="sphere-background"] .hero .subpage-hero-column,
body[data-jadey-surface="sphere-background"] .hero .hero-copy,
body[data-jadey-surface="sphere-background"] .hero .subpage-hero-copy {
  width: 100%;
  max-width: none;
  justify-self: stretch;
}

body[data-jadey-template="homepage"] .hero-shell {
  transform: translate3d(0, calc(var(--jd-home-scroll-value) * -0.035px), 0);
  transition: transform 120ms linear;
  will-change: transform;
}

body[data-jadey-template="homepage"] .hero-copy {
  position: relative;
  z-index: 2;
  opacity: clamp(var(--jd-home-hero-copy-opacity-min), calc(1 - (var(--jd-home-hero-progress) * 0.28)), 1);
  transform: translate3d(0, calc(var(--jd-home-scroll-value) * -0.085px), 0);
  transition: transform 120ms linear, opacity 120ms linear;
  will-change: transform, opacity;
}

body[data-jadey-template="homepage"] .page-main > .section:not(.hero),
body[data-jadey-surface="sphere-background"] .page-main > .section:not(.hero) {
  border-top: none;
  border-bottom: none;
}

body[data-jadey-template="homepage"] .page-main > .section.section--surface-highlight:not(.hero),
body[data-jadey-surface="sphere-background"] .page-main > .section.section--surface-highlight:not(.hero) {
  border-top: none;
  border-bottom: none;
}

body[data-jadey-template="homepage"] #proof-of-value {
  background: #000;
}

body[data-jadey-template="homepage"] .page-main > .section:not(.hero) > .section-shell,
body[data-jadey-template="homepage"] .page-main > .section.section--width-measure:not(.hero) > .section-shell,
body[data-jadey-template="homepage"] .page-main > .section.section--width-full:not(.hero) > .section-shell,
body[data-jadey-surface="sphere-background"] .page-main > .section:not(.hero) > .section-shell,
body[data-jadey-surface="sphere-background"] .page-main > .section.section--width-measure:not(.hero) > .section-shell,
body[data-jadey-surface="sphere-background"] .page-main > .section.section--width-full:not(.hero) > .section-shell {
  position: relative;
  z-index: 2;
  width: min(50%, var(--container));
  max-width: var(--container);
  margin-inline: auto;
}

.hero-visual {
  display: flex;
  width: 100%;
  justify-content: flex-end;
  align-items: center;
  min-height: auto;
}

body[data-jadey-template="homepage"] .hero-visual {
  position: relative;
  z-index: 2;
  transform: translate3d(0, calc(var(--jd-home-scroll-value) * -0.03px), 0);
  transition: transform 120ms linear;
  will-change: transform;
}

.hero-animation {
  position: relative;
  width: min(100%, 560px);
  height: clamp(320px, 42vw, 460px);
  overflow: hidden;
  background: transparent;
}

.hero-animation-placeholder {
  display: block;
  width: min(100%, 560px);
  height: clamp(320px, 42vw, 460px);
  flex: 0 0 min(100%, 560px);
  pointer-events: none;
  visibility: hidden;
}

body[data-jadey-template="homepage"] .hero-animation.is-viewport-pinned {
  position: fixed;
  top: var(--jd-home-hero-sphere-top);
  left: var(--jd-home-hero-sphere-left);
  z-index: 1;
  width: var(--jd-home-hero-sphere-width);
  height: var(--jd-home-hero-sphere-height);
  opacity: var(--jd-home-hero-sphere-opacity);
  pointer-events: none;
  transform:
    translate3d(
      var(--jd-home-hero-sphere-translate-x),
      var(--jd-home-hero-sphere-translate-y),
      0
    )
    scale(var(--jd-home-hero-sphere-scale));
  transform-origin: center;
  transition: none;
  will-change: opacity, transform;
  contain: layout paint;
}

body[data-jadey-surface="sphere-background"] .hero-animation.is-page-background-sphere {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: min(100%, 560px);
  height: clamp(320px, 42vw, 460px);
  min-width: 0;
  min-height: 0;
  opacity: 0.2;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0) scale(2.4);
  transform-origin: center;
  will-change: transform;
  contain: layout paint;
}

body[data-jadey-template="homepage"] .hero-animation::before {
  content: "";
  position: absolute;
  inset: 12% 10%;
  z-index: 0;
  pointer-events: none;
  background: var(--jd-home-hero-glow);
  filter: blur(var(--jd-home-hero-glow-blur));
  opacity: 0.9;
}

.hero-animation-canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.hero-animation-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

body[data-jadey-template="homepage"] .scroll-reveal {
  opacity: 0;
  transform: translate3d(0, 42px, 0) scale(0.985);
  filter: blur(8px);
  transition:
    opacity 0.82s ease,
    transform 0.82s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.82s ease;
  will-change: opacity, transform, filter;
}

body[data-jadey-template="homepage"] .scroll-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

@media (max-width: 980px) {
  body[data-jadey-template="homepage"] .page-main > .section:not(.hero) > .section-shell,
  body[data-jadey-template="homepage"] .page-main > .section.section--width-measure:not(.hero) > .section-shell,
  body[data-jadey-template="homepage"] .page-main > .section.section--width-full:not(.hero) > .section-shell,
  body[data-jadey-surface="sphere-background"] .page-main > .section:not(.hero) > .section-shell,
  body[data-jadey-surface="sphere-background"] .page-main > .section.section--width-measure:not(.hero) > .section-shell,
  body[data-jadey-surface="sphere-background"] .page-main > .section.section--width-full:not(.hero) > .section-shell,
  body[data-jadey-surface="sphere-background"] .hero .section-shell {
    width: calc(100% - (var(--page-padding) * 2));
  }

  body[data-jadey-template="homepage"] .hero,
  body[data-jadey-surface="sphere-background"] .hero {
    background-attachment: scroll;
  }

  .hero-visual {
    order: -1;
    justify-content: center;
    min-height: auto;
  }

  .hero-animation {
    width: min(100%, 480px);
    height: clamp(280px, 72vw, 420px);
  }

  .hero-animation-placeholder {
    width: min(100%, 480px);
    height: clamp(280px, 72vw, 420px);
    flex-basis: min(100%, 480px);
  }

  body[data-jadey-surface="sphere-background"] .hero-animation.is-page-background-sphere {
    width: min(100%, 480px);
    height: clamp(280px, 72vw, 420px);
    min-width: 0;
    min-height: 0;
    transform: translate3d(-50%, -50%, 0) scale(1.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-jadey-template="homepage"] .hero,
  body[data-jadey-surface="sphere-background"] .hero {
    background-attachment: scroll;
  }

  body[data-jadey-template="homepage"] .hero::before,
  body[data-jadey-template="homepage"] .hero-shell,
  body[data-jadey-template="homepage"] .hero-copy,
  body[data-jadey-template="homepage"] .hero-visual,
  body[data-jadey-template="homepage"] .scroll-reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
