.hero-visual {
  transform-style: preserve-3d;
  perspective: 1200px;
}

.hero-visual::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.22) 48%, transparent 52%) 0 0 / 220% 220% no-repeat;
  mix-blend-mode: screen;
  animation: hero-surface-sweep 11s ease-in-out infinite;
}

.hero-orb {
  will-change: transform, opacity;
}

.hero-orb.one {
  animation: hero-orb-drift-a 16s ease-in-out infinite;
}

.hero-orb.two {
  animation: hero-orb-drift-b 19s ease-in-out infinite;
}

.hero-orb.three {
  animation: hero-orb-drift-c 21s ease-in-out infinite;
}

.hero-ui-card-top,
.hero-ui-card-code,
.hero-ui-card-network,
.hero-ui-card-stack,
.hero-panel {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.hero-ui-card-top::before,
.hero-panel::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background: linear-gradient(120deg, transparent 34%, rgba(255, 255, 255, 0.26) 50%, transparent 66%);
  transform: translateX(-120%);
}

.hero-ui-card-top::before {
  animation: hero-shimmer 9s ease-in-out infinite;
}

.hero-panel::before {
  animation: hero-shimmer 11s ease-in-out infinite 1.2s;
}

.hero-ui-card-top .tag {
  position: relative;
  animation: hero-tag-glow 3.8s ease-in-out infinite;
}

.hero-ui-card-top .tag:nth-child(2) {
  animation-delay: 1.4s;
}

.hero-ui-card-top h2 {
  margin-top: 0.95rem;
}

.hero-ui-card-code code {
  position: relative;
  display: grid;
  gap: 0.45rem;
  white-space: normal;
}

.hero-ui-card-code code span {
  display: block;
  opacity: 0;
  transform: translateY(6px);
  animation: hero-line-reveal 640ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero-ui-card-code code span:nth-child(1) {
  animation-delay: 240ms;
}

.hero-ui-card-code code span:nth-child(2) {
  animation-delay: 340ms;
}

.hero-ui-card-code code span:nth-child(3) {
  animation-delay: 440ms;
}

.hero-ui-card-code code span:nth-child(4) {
  animation-delay: 540ms;
}

.hero-ui-card-code code::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(185, 232, 242, 0.18) 50%, transparent 100%);
  transform: translateY(-120%);
  animation: hero-scanline 6.5s ease-in-out infinite;
  pointer-events: none;
}

.hero-ui-card-code code::after {
  content: "";
  position: absolute;
  right: 1rem;
  bottom: 0.95rem;
  width: 0.45rem;
  height: 1.1rem;
  border-radius: 9999px;
  background: rgba(185, 232, 242, 0.92);
  box-shadow: 0 0 14px rgba(0, 207, 234, 0.7);
  animation: hero-cursor-blink 1.05s steps(2, end) infinite;
  pointer-events: none;
}

.hero-ui-card-network {
  min-height: 9rem;
}

.network-grid {
  position: relative;
  overflow: hidden;
}

.network-grid::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 207, 234, 0.16), transparent);
  transform: translateX(-120%);
  animation: hero-network-sweep 8s linear infinite;
}

.network-grid span {
  will-change: transform, opacity, box-shadow;
}

.network-grid .node {
  animation: hero-node-pulse 2.8s ease-in-out infinite;
}

.network-grid .n1 {
  animation-delay: 0s;
}

.network-grid .n2 {
  animation-delay: 700ms;
}

.network-grid .n3 {
  animation-delay: 1.2s;
}

.hero-ui-card-stack .tag,
.hero-panel .tag {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.hero-ui-card-stack .tag:hover,
.hero-panel .tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(25, 118, 210, 0.12);
}

body.page-ready .hero-card {
  animation: hero-shell-in 780ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.page-ready .hero-ui-card-top,
body.page-ready .hero-ui-card-code,
body.page-ready .hero-ui-card-network,
body.page-ready .hero-ui-card-stack,
body.page-ready .hero-panel {
  animation: hero-rise-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.page-ready .hero-ui-card-top {
  animation-delay: 120ms;
}

body.page-ready .hero-ui-card-code {
  animation-delay: 220ms;
}

body.page-ready .hero-ui-card-network {
  animation-delay: 320ms;
}

body.page-ready .hero-ui-card-stack {
  animation-delay: 440ms;
}

body.page-ready .hero-panel {
  animation-delay: 560ms;
}

body.page-ready .hero-ui-card-stack .tag {
  animation: hero-pill-rise 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.page-ready .hero-ui-card-stack .tag:nth-child(1) {
  animation-delay: 480ms;
}

body.page-ready .hero-ui-card-stack .tag:nth-child(2) {
  animation-delay: 560ms;
}

body.page-ready .hero-ui-card-stack .tag:nth-child(3) {
  animation-delay: 640ms;
}

@media (hover: hover) and (pointer: fine) {
  .hero-card {
    transform-origin: center;
    transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
  }

  .hero-card:hover {
    transform: translateY(-6px) scale(1.005);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.12);
  }

  .dark .hero-card:hover {
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card,
  .hero-orb,
  .hero-ui-card,
  .hero-panel,
  .hero-ui-card-top .tag,
  .hero-ui-card-code code span,
  .network-grid .node {
    animation: none !important;
    transform: none !important;
  }
}

@keyframes hero-shell-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-rise-in {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-tag-glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(0, 207, 234, 0);
    transform: translateY(0);
  }

  50% {
    box-shadow: 0 0 18px rgba(0, 207, 234, 0.16);
    transform: translateY(-1px);
  }
}

@keyframes hero-shimmer {
  0% {
    transform: translateX(-120%);
  }

  65%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes hero-surface-sweep {
  0%,
  18% {
    opacity: 0;
    transform: translateX(-22%) translateY(-4%) scale(1);
  }

  28% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.12;
    transform: translateX(8%) translateY(1%) scale(1.03);
  }

  100% {
    opacity: 0;
    transform: translateX(16%) translateY(4%) scale(1.05);
  }
}

@keyframes hero-orb-drift-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(10px, 14px, 0) scale(1.08);
  }
}

@keyframes hero-orb-drift-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-14px, 10px, 0) scale(1.07);
  }
}

@keyframes hero-orb-drift-c {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(8px, -12px, 0) scale(1.06);
  }
}

@keyframes hero-line-reveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-scanline {
  0% {
    transform: translateY(-120%);
  }

  100% {
    transform: translateY(120%);
  }
}

@keyframes hero-cursor-blink {
  0%,
  48% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0.2;
  }
}

@keyframes hero-network-sweep {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }

  12% {
    opacity: 0.28;
  }

  55% {
    opacity: 0.14;
  }

  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

@keyframes hero-node-pulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(0.92);
    box-shadow: 0 0 0 1px rgba(0, 207, 234, 0.08), 0 10px 24px rgba(25, 118, 210, 0.12);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 0 1px rgba(0, 207, 234, 0.2), 0 0 24px rgba(0, 207, 234, 0.24), 0 20px 40px rgba(25, 118, 210, 0.18);
  }
}

@keyframes hero-pill-rise {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
