/* Hero animation foundation */

:root {
  --as-hero-stars-layer: url("../hero/stars-layer.svg");
  --as-hero-moon-layer: url("../hero/moon.svg");
  --as-hero-sun-layer: url("../hero/sun.svg");
  --as-hero-land-layer: url("../hero/land-at-dawn.svg");
  --as-hero-brand-layer: url("../hero/neon-flicker.svg");
  --as-hero-crow-layer: url("../hero/crow-animation.svg");
  --as-hero-street-light-layer: url("../hero/street-light-above-the-door.svg");
  --as-hero-motorhome-light-layer: url("../hero/light-in-a-motorhome.svg");
  --as-hero-cow-layer: url("../hero/cow-at-sunset.svg");
}

.hero-screen {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  width: 100vw;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
  background-color: #000;
}

.hero-screen.alignfull,
.wp-block-group.alignfull.hero-screen {
  max-width: 100vw !important;
}

.hero-screen[data-hero-theme="dawn"] {
  background: linear-gradient(180deg, #7dbdff 0%, #b9defe 56%, #eaf6ff 100%);
  --as-hero-land-layer: url("../hero/land-at-dawn.svg");
  --as-hero-cow-layer: url("../hero/cow-at-dawn.svg");
}

.hero-screen[data-hero-theme="sunset"] {
  --as-hero-land-layer: url("../hero/land-at-sunset.svg");
  --as-hero-cow-layer: url("../hero/cow-at-sunset.svg");
  background:
    radial-gradient(
      140% 62% at 50% 108%,
      rgba(162, 203, 255, 0.68) 0%,
      rgba(82, 122, 184, 0.42) 40%,
      rgba(18, 33, 61, 0) 66%
    ),
    linear-gradient(180deg, #0b1530 0%, #183d76 34%, #3b73bc 64%, #92c2f2 100%);
}

.hero-screen,
.hero-screen.has-global-padding {
  padding: 0 !important;
}

@supports (height: 100dvh) {
  .hero-screen {
    min-height: 100dvh;
    height: 100dvh;
  }
}

.hero-animation-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  isolation: isolate;
  max-width: none !important;
  margin: 0 !important;
}

.hero-screen.wp-block-group-is-layout-constrained > .hero-animation-stage {
  max-width: none !important;
}

.hero-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-layer--stars {
  position: absolute;
  inset: -8%;
  z-index: 1;
  background-image: var(--as-hero-stars-layer);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 116% 116%;
  opacity: 0.9;
  overflow: hidden;
  filter: saturate(1.08) contrast(1.03);
  transform-origin: center;
}

/* Stars are temporarily disabled; keep the layer for easy rollback. */
.hero-layer--stars {
  display: none;
}

.hero-layer--stars::before,
.hero-layer--stars::after {
  content: "";
  position: absolute;
  inset: -8%;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-layer--stars::before {
  background:
    radial-gradient(circle at 18% 24%, rgba(126, 186, 255, 0.2) 0%, transparent 38%),
    radial-gradient(circle at 76% 18%, rgba(95, 137, 229, 0.16) 0%, transparent 36%),
    radial-gradient(circle at 56% 74%, rgba(125, 177, 247, 0.14) 0%, transparent 42%);
  mix-blend-mode: screen;
  opacity: 0.42;
  animation: as-hero-nebula-drift 34s ease-in-out infinite alternate;
}

.hero-layer--stars::after {
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.24) 0%, transparent 26%),
    radial-gradient(circle at 82% 36%, rgba(198, 229, 255, 0.2) 0%, transparent 24%),
    radial-gradient(circle at 62% 78%, rgba(169, 208, 255, 0.15) 0%, transparent 22%);
  mix-blend-mode: screen;
  opacity: 0.36;
  filter: blur(0.6px);
  animation: as-hero-stars-pulse 10s ease-in-out infinite;
}

.hero-screen[data-hero-theme="dawn"] .hero-layer--stars {
  opacity: 0.2;
}

.hero-screen[data-hero-theme="dawn"] .hero-layer--stars::before {
  opacity: 0.08;
}

.hero-screen[data-hero-theme="dawn"] .hero-layer--stars::after {
  opacity: 0.06;
}

.hero-layer--back {
  z-index: 2;
}

.hero-layer--mid {
  z-index: 3;
}

.hero-layer--front {
  z-index: 4;
}

.hero-layer--fx {
  z-index: 5;
  mix-blend-mode: screen;
}

.hero-screen[data-hero-theme="dawn"] .hero-layer--back,
.hero-screen[data-hero-theme="dawn"] .hero-layer--mid,
.hero-screen[data-hero-theme="dawn"] .hero-layer--front {
  opacity: 0.52;
}

.hero-screen[data-hero-theme="dawn"] .hero-layer--fx {
  opacity: 0.18;
}

.hero-celestial {
  position: absolute;
  left: 50%;
  top: 42%;
  width: clamp(230px, 28vw, 520px);
  aspect-ratio: 1 / 1;
  z-index: 7;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-celestial__asset {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  visibility: hidden;
  opacity: 0;
  transform: translate3d(0, 190px, 0) scale(0.9);
  transition: transform 1.08s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.62s ease;
  will-change: transform, opacity;
}

.hero-celestial__asset.is-visible,
.hero-celestial__asset.is-leaving {
  visibility: visible;
}

.hero-celestial__asset--moon {
  background-image: var(--as-hero-moon-layer);
  filter:
    drop-shadow(0 0 46px rgba(224, 241, 255, 0.78))
    drop-shadow(0 0 104px rgba(176, 214, 255, 0.54))
    drop-shadow(0 0 158px rgba(146, 191, 255, 0.24));
}

.hero-celestial__asset--sun {
  background-image: var(--as-hero-sun-layer);
  filter:
    drop-shadow(0 0 60px rgba(255, 201, 108, 0.9))
    drop-shadow(0 0 126px rgba(255, 158, 58, 0.66))
    drop-shadow(0 0 184px rgba(255, 124, 34, 0.34));
}

.hero-celestial__asset.is-visible {
  opacity: 1;
  transform: translate3d(0, -96px, 0) scale(1);
}

.hero-celestial__asset.is-leaving {
  opacity: 1;
  transform: translate3d(0, 72vh, 0) scale(0.92);
}

.hero-horizon,
.hero-brand,
.hero-crow,
.hero-street-light,
.hero-motorhome-light,
.hero-cow {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  border-radius: 0;
  z-index: 8;
  pointer-events: none;
  max-width: none !important;
  margin: 0 !important;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
}

.hero-horizon {
  z-index: 7;
  background-image: var(--as-hero-land-layer);
}

.hero-brand {
  z-index: 10;
  background-image: var(--as-hero-brand-layer);
  opacity: 1;
  transition: opacity 220ms ease;
}

.hero-screen[data-hero-neon="off"] .hero-brand {
  opacity: 0;
}

.hero-crow {
  z-index: 11;
  background-image: var(--as-hero-crow-layer);
}

.hero-street-light {
  background-image: var(--as-hero-street-light-layer);
  opacity: 0;
  transition: opacity 220ms ease;
}

.hero-screen[data-hero-street-light="on"] .hero-street-light {
  opacity: 1;
}

.hero-motorhome-light {
  background-image: var(--as-hero-motorhome-light-layer);
  opacity: 0;
  transition: opacity 220ms ease;
}

.hero-screen[data-hero-motorhome-light="on"] .hero-motorhome-light {
  opacity: 1;
}

.hero-cow {
  z-index: 9;
  background-image: var(--as-hero-cow-layer);
  background-size: 100% auto;
}

.hero-theme-toggle-wrap {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 11;
  pointer-events: auto;
}

.hero-theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 56px;
  min-width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease;
}

.hero-theme-toggle:hover {
  transform: translateY(-1px);
}

.hero-theme-toggle:active {
  transform: translateY(0) scale(0.97);
}

.hero-theme-toggle:focus,
.hero-theme-toggle:focus-visible {
  outline: none;
  box-shadow: none;
}

.hero-theme-toggle__thumb {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  transform: rotate(0deg);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.38s ease,
    box-shadow 0.38s ease;
}

.hero-theme-toggle__icon {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.hero-theme-toggle__icon .as-toggle-cut {
  transform: translateX(0);
  transform-origin: center;
  transform-box: fill-box;
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-theme-toggle__icon .as-toggle-stop {
  transition: stop-color 0.46s ease;
}

.hero-theme-toggle__icon .as-toggle-stop--1 {
  stop-color: #ffffff;
}

.hero-theme-toggle__icon .as-toggle-stop--2 {
  stop-color: #eef3ff;
}

.hero-theme-toggle__icon .as-toggle-stop--3 {
  stop-color: #d5def8;
}

.hero-theme-toggle__icon .as-toggle-craters {
  opacity: 0.22;
  transition: opacity 0.46s ease;
}

.hero-theme-toggle__icon .as-toggle-crater {
  fill: rgba(16, 26, 48, 0.26);
}

.hero-screen[data-hero-theme="dawn"] .hero-theme-toggle__thumb {
  transform: rotate(-18deg);
}

.hero-screen[data-hero-theme="dawn"] .hero-theme-toggle__icon {
  filter: drop-shadow(0 4px 10px rgba(110, 45, 15, 0.22));
}

.hero-screen[data-hero-theme="dawn"] .hero-theme-toggle__icon .as-toggle-cut {
  transform: translateX(92px);
}

.hero-screen[data-hero-theme="dawn"] .hero-theme-toggle__icon .as-toggle-stop--1 {
  stop-color: #fff6d6;
}

.hero-screen[data-hero-theme="dawn"] .hero-theme-toggle__icon .as-toggle-stop--2 {
  stop-color: #ffd27a;
}

.hero-screen[data-hero-theme="dawn"] .hero-theme-toggle__icon .as-toggle-stop--3 {
  stop-color: #ffb74a;
}

.hero-screen[data-hero-theme="dawn"] .hero-theme-toggle__icon .as-toggle-craters {
  opacity: 0;
}

.hero-theme-toggle__text {
  display: none;
}

.hero-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.65) 72%);
}

.hero-screen[data-hero-theme="dawn"]::after {
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.52) 0%, rgba(98, 163, 217, 0.18) 66%, rgba(65, 119, 171, 0.2) 100%);
}

.hero-screen[data-hero-theme="sunset"]::after {
  background: radial-gradient(circle at 50% 43%, rgba(228, 244, 255, 0.28) 0%, rgba(5, 9, 18, 0.14) 76%);
}

.hero-node {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  opacity: var(--opacity, 0.75);
  transform: translate(-50%, -50%);
  transform-origin: center;
  will-change: transform, opacity;
}

.hero-node--orb {
  width: var(--size, 220px);
  height: var(--size, 220px);
  border-radius: 999px;
  filter: blur(var(--blur, 18px));
  background: radial-gradient(
    circle at 35% 35%,
    hsl(var(--hue, 215) 95% 78% / 0.95) 0%,
    hsl(var(--hue, 215) 95% 60% / 0.35) 40%,
    transparent 75%
  );
  animation: as-hero-drift var(--duration, 26s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.hero-node--spark {
  width: var(--size, 4px);
  height: var(--size, 4px);
  border-radius: 999px;
  background: hsl(var(--spark-hue, 214) 100% 94% / 0.96);
  box-shadow:
    0 0 0 1px hsl(var(--spark-hue, 214) 100% 96% / 0.16),
    0 0 16px 4px hsl(var(--spark-hue, 214) 100% 80% / var(--spark-glow, 0.24));
  mix-blend-mode: screen;
  animation: as-hero-twinkle var(--duration, 4.6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.hero-node--spark-major {
  box-shadow:
    0 0 0 1px hsl(var(--spark-hue, 214) 100% 97% / 0.26),
    0 0 20px 6px hsl(var(--spark-hue, 214) 100% 82% / var(--spark-glow, 0.64));
}

.hero-node--spark-major::before,
.hero-node--spark-major::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-node--spark-major::before {
  width: 260%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    hsl(var(--spark-hue, 214) 100% 90% / 0.84) 50%,
    transparent 100%
  );
  opacity: 0.66;
  animation: as-hero-major-ray-x 6.1s ease-in-out infinite;
}

.hero-node--spark-major::after {
  width: 1px;
  height: 260%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    hsl(var(--spark-hue, 214) 100% 90% / 0.8) 50%,
    transparent 100%
  );
  opacity: 0.62;
  animation: as-hero-major-ray-y 7.2s ease-in-out infinite;
}

.hero-node--cluster {
  width: var(--size, 190px);
  height: var(--size, 190px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.92) 0 3px, transparent 4px),
    radial-gradient(circle at 64% 42%, rgba(255, 255, 255, 0.82) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 70%, rgba(255, 255, 255, 0.64) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 75%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 22% 63%, rgba(255, 255, 255, 0.52) 0 2px, transparent 3px);
  filter: blur(var(--blur, 0.35px));
  animation: as-hero-drift var(--duration, 34s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.hero-node--dust {
  width: var(--size, 300px);
  height: var(--size, 300px);
  border-radius: 999px;
  filter: blur(var(--blur, 32px));
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  animation: as-hero-drift var(--duration, 30s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.hero-screen[data-hero-status="booting"] .hero-layer--back,
.hero-screen[data-hero-status="booting"] .hero-layer--mid,
.hero-screen[data-hero-status="booting"] .hero-layer--front,
.hero-screen[data-hero-status="booting"] .hero-layer--fx {
  opacity: 0;
}

.hero-screen[data-hero-status="ready"] .hero-layer {
  transition: opacity 0.9s ease;
}

@keyframes as-hero-drift {
  0% {
    transform: translate(-50%, -50%) translate3d(calc(var(--drift-x, 20px) * -1), calc(var(--drift-y, 12px) * -1), 0) scale(0.98);
  }
  100% {
    transform: translate(-50%, -50%) translate3d(var(--drift-x, 20px), var(--drift-y, 12px), 0) scale(1.03);
  }
}

@keyframes as-hero-twinkle {
  0%,
  100% {
    opacity: calc(var(--opacity, 0.75) * 0.55);
    transform: translate(-50%, -50%) scale(0.85);
  }
  50% {
    opacity: var(--opacity, 0.75);
    transform: translate(-50%, -50%) scale(1.12);
  }
}

@keyframes as-hero-nebula-drift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  100% {
    transform: translate3d(2%, 1%, 0) scale(1.06);
  }
}

@keyframes as-hero-stars-pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    opacity: 0.44;
    transform: translate3d(-1.2%, 1.1%, 0) scale(1.03);
  }
}

@keyframes as-hero-major-ray-x {
  0%,
  100% {
    opacity: 0.22;
    transform: translate(-50%, -50%) scaleX(0.7);
  }
  50% {
    opacity: 0.78;
    transform: translate(-50%, -50%) scaleX(1.16);
  }
}

@keyframes as-hero-major-ray-y {
  0%,
  100% {
    opacity: 0.2;
    transform: translate(-50%, -50%) scaleY(0.7);
  }
  50% {
    opacity: 0.74;
    transform: translate(-50%, -50%) scaleY(1.18);
  }
}

@media (max-width: 820px) {
  .hero-screen {
    --as-hero-brand-layer: url("../hero/neon-flicker-mobile.svg");
  }

  .hero-screen[data-hero-theme="sunset"] {
    --as-hero-land-layer: url("../hero/land-at-sunset-mobile.svg");
    --as-hero-cow-layer: url("../hero/cow-at-sunset-mobile.svg");
  }

  .hero-screen[data-hero-theme="dawn"] {
    --as-hero-land-layer: url("../hero/land-at-dawn-mobile.svg");
    --as-hero-cow-layer: url("../hero/cow-at-dawn-mobile.svg");
  }

  .hero-screen {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }

  @supports (width: 100dvw) {
    .hero-screen {
      width: 100dvw !important;
      max-width: 100dvw !important;
      margin-left: calc(50% - 50dvw) !important;
      margin-right: calc(50% - 50dvw) !important;
    }
  }

  .hero-layer--stars {
    inset: -14%;
    background-size: 132% 132%;
  }

  .hero-layer--stars::before,
  .hero-layer--stars::after {
    inset: -14%;
  }

  .hero-celestial {
    width: clamp(150px, 42vw, 280px);
    top: 40%;
  }

	  .hero-horizon,
	  .hero-brand,
	  .hero-crow,
	  .hero-street-light,
	  .hero-motorhome-light,
	  .hero-cow {
	    width: 100vw;
	    height: 100%;
	    background-size: 100% auto;
	    background-position: center bottom;
	  }

  .hero-theme-toggle {
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding-right: 0;
  }

  .hero-theme-toggle__thumb {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-layer,
  .hero-layer--stars::before,
  .hero-layer--stars::after,
  .hero-node,
  .hero-node--spark-major::before,
  .hero-node--spark-major::after,
  .hero-celestial,
  .hero-celestial__asset,
  .hero-theme-toggle,
  .hero-theme-toggle__thumb,
  .hero-theme-toggle__icon,
  .hero-theme-toggle__icon * {
    animation: none !important;
    transition: none !important;
  }
}
