/* ── Home page hero only ── */
.hero-home {
  position: relative;
  overflow: hidden;
  min-height: 90vh;
  display: flex;
  align-items: center;
}

/* Rich animated gradient base */
.hero-bg-animated {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    #bfdbfe 0%,
    #dbeafe 25%,
    #eff6ff 50%,
    #dbeafe 75%,
    #bfdbfe 100%
  );
  background-size: 300% 300%;
  animation: hero-gradient-shift 14s ease infinite;
  pointer-events: none;
}

@keyframes hero-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Large gradient orbs */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}

/* Blue — top left */
.hero-blob-1 {
  width: min(560px, 65vw);
  height: min(560px, 65vw);
  top: -15%;
  left: -10%;
  background: rgba(59, 130, 246, 0.45);
  animation: hero-blob-drift-a 16s ease-in-out infinite;
}

/* Cyan — center right */
.hero-blob-2 {
  width: min(480px, 55vw);
  height: min(480px, 55vw);
  top: 20%;
  right: -12%;
  background: rgba(34, 211, 238, 0.35);
  animation: hero-blob-drift-b 18s ease-in-out infinite;
}

/* Purple — bottom left */
.hero-blob-3 {
  width: min(420px, 50vw);
  height: min(420px, 50vw);
  bottom: -10%;
  left: 5%;
  background: rgba(139, 92, 246, 0.28);
  animation: hero-blob-drift-c 14s ease-in-out infinite;
}

@keyframes hero-blob-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, 25px) scale(1.06); }
  66% { transform: translate(-20px, 15px) scale(0.96); }
}

@keyframes hero-blob-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-35px, 20px) scale(1.08); }
}

@keyframes hero-blob-drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -30px) scale(1.05); }
}

/* Subtle noise texture */
.hero-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Moving grid */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 40%, black 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 40%, black 15%, transparent 72%);
  animation: hero-grid-drift 30s linear infinite;
  pointer-events: none;
}

@keyframes hero-grid-drift {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* Soft floating particles */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
  animation: hero-particle-float var(--dur, 14s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes hero-particle-float {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.4); }
  15% { opacity: 0.5; }
  50% { opacity: 0.25; transform: translateY(-100px) scale(1); }
  85% { opacity: 0; }
}

/* Keyboard texture */
.hero-home-bg {
  position: absolute;
  inset: -20px;
  background: url("../media/hero-keyboard-ref.png") center 30% / cover no-repeat;
  filter: blur(22px) brightness(1.05) saturate(0.45);
  transform: scale(1.06);
  opacity: 0.12;
  pointer-events: none;
}

/* Bottom fade */
.hero-fade-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, #ffffff);
  pointer-events: none;
  z-index: 2;
}

/* Inner layout */
.hero-home-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 6.5rem 1.25rem 4.5rem;
}

@media (min-width: 640px) {
  .hero-home-inner { padding: 7rem 1.75rem 5rem; }
}

@media (min-width: 1024px) {
  .hero-home-inner { padding: 7.5rem 2rem 5.5rem; }
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-layout {
    grid-template-columns: 1fr 1.05fr;
    gap: 4.5rem;
  }
}

/* Load animations */
.hero-animate-in {
  opacity: 0;
  transform: translateY(28px);
  animation: hero-fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-animate-in-delay {
  animation-delay: 0.2s;
}

@keyframes hero-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* Left column */
.hero-left {
  text-align: center;
}

@media (min-width: 1024px) {
  .hero-left { text-align: left; }
}

.hero-headline-tagline {
  display: inline-block;
  margin-bottom: 1.125rem;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 9999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(59, 130, 246, 0.12);
}

@media (min-width: 640px) {
  .hero-headline-tagline { font-size: 0.8125rem; }
}

.hero-headline-main {
  font-size: clamp(2.625rem, 7.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: #020617;
  margin-bottom: 1.5rem;
}

.hero-headline-main span {
  display: block;
  color: #020617;
  background: none;
  -webkit-text-fill-color: #020617;
}

.hero-description {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #64748b;
  max-width: 28rem;
  margin: 0 auto 2.25rem;
}

@media (min-width: 1024px) {
  .hero-description { margin: 0 0 2.5rem; }
}

.hero-description strong {
  color: #1e293b;
  font-weight: 600;
}

.hero-description p + p {
  margin-top: 1rem;
}

/* CTA buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: flex-start;
}

@media (min-width: 1024px) {
  .hero-actions { justify-content: flex-start; }
}

.btn-hero-dl {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.875rem;
  color: #fff;
  text-align: center;
  text-decoration: none;
  padding: 1rem 2.25rem;
  min-width: 11.5rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.1),
    0 8px 28px -4px rgba(37, 99, 235, 0.55),
    0 0 0 1px rgba(37, 99, 235, 0.15);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease;
}

.btn-hero-dl:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  transform: translateY(-4px);
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.12),
    0 20px 48px -8px rgba(37, 99, 235, 0.6),
    0 0 32px rgba(59, 130, 246, 0.25);
}

.btn-hero-dl:active {
  transform: translateY(-2px);
}

.btn-hero-dl strong {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-hero-dl strong svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.btn-hero-dl .btn-hero-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.3;
}

.btn-hero-dl .btn-hero-variants {
  display: block;
  font-size: 0.6875rem;
  margin-top: 0.25rem;
  padding-top: 0.375rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  line-height: 1.3;
  opacity: 0.85;
  width: 100%;
}

.btn-hero-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.75rem;
  min-height: 3.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1e293b;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.875rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateY(-4px);
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(59, 130, 246, 0.1);
}

.btn-hero-ghost:active {
  transform: translateY(-2px);
}

/* Right column: app preview */
.hero-right {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

@media (min-width: 1024px) {
  .hero-right { justify-content: flex-end; }
}

.hero-preview {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 540px;
  animation: hero-float 5.5s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg);
  }
  50% {
    transform: translateY(-16px) rotateX(1.5deg) rotateY(-2deg);
  }
}

/* Ambient glow orbs behind app */
.hero-preview-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90%;
  height: 120%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.45) 0%, rgba(34, 211, 238, 0.2) 45%, transparent 70%);
  filter: blur(36px);
  pointer-events: none;
  z-index: 0;
  animation: hero-aura-pulse 4s ease-in-out infinite;
}

.hero-preview-aura-2 {
  width: 70%;
  height: 90%;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.25) 0%, transparent 65%);
  filter: blur(28px);
  animation-delay: -2s;
  animation-duration: 5s;
}

@keyframes hero-aura-pulse {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -52%) scale(1.06); }
}

/* Image stage */
.hero-preview-stage {
  position: relative;
  z-index: 2;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-preview:hover .hero-preview-stage {
  transform: translateY(-6px) scale(1.03) rotateX(2deg) rotateY(-3deg);
}

.hero-preview-img {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  outline: none;
  border-radius: 6px;
  background: transparent;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.12))
          drop-shadow(0 24px 48px rgba(37, 99, 235, 0.28))
          drop-shadow(0 0 40px rgba(56, 189, 248, 0.18));
  transition: filter 0.4s ease;
}

.hero-preview:hover .hero-preview-img {
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.15))
          drop-shadow(0 32px 64px rgba(37, 99, 235, 0.38))
          drop-shadow(0 0 56px rgba(56, 189, 248, 0.3));
}

/* Light sweep across window */
.hero-preview-shine {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 42%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 58%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: hero-shine-sweep 5s ease-in-out infinite;
  mix-blend-mode: overlay;
}

@keyframes hero-shine-sweep {
  0%, 100% { background-position: 200% 0; opacity: 0; }
  10% { opacity: 1; }
  50% { background-position: -100% 0; opacity: 1; }
  60%, 100% { opacity: 0; }
}

/* Soft ground shadow */
.hero-preview-shadow {
  position: absolute;
  bottom: -8%;
  left: 50%;
  z-index: 1;
  width: 75%;
  height: 20%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.35) 0%, transparent 70%);
  filter: blur(16px);
  pointer-events: none;
  animation: hero-shadow-pulse 5.5s ease-in-out infinite;
}

@keyframes hero-shadow-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.75; transform: translateX(-50%) scale(0.92); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-bg-animated,
  .hero-blob,
  .hero-grid,
  .hero-particle,
  .hero-preview,
  .hero-preview-aura,
  .hero-preview-shine,
  .hero-preview-shadow,
  .hero-animate-in,
  .hero-animate-in-delay {
    animation: none !important;
  }

  .hero-animate-in,
  .hero-animate-in-delay {
    opacity: 1;
    transform: none;
  }

  .hero-preview:hover .hero-preview-stage {
    transform: none;
  }
}
