/* Hero */

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-height, 64px));
  display: block;
  background: white;
  padding: 0;
  margin: 0;
  overflow: visible; /* allow right-side visual to spill into page margin */
  z-index: 1;
}

.hero__container {
  position: relative;
  z-index: 10;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem; /* horizontal only */
  min-height: calc(100vh - var(--nav-height, 64px));
  display: flex;
  align-items: center; /* vertical center */
}

.hero__content {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .hero__content {
    max-width: 70%;
    width: 70%;
  }
}

.hero__title {
  font-weight: 800;
  color: rgb(15, 23, 42); /* slate-900 */
  letter-spacing: -0.02em;
  line-height: 1.15; /* match rotator line-height for consistent baseline spacing */
  margin: 0 0 1rem 0;
  font-size: 2.25rem; /* 36px */
}

@media (min-width: 640px) {
  .hero__title {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .hero__title {
    font-size: 3.75rem; /* 60px */
  }
}

.hero__title-line {
  display: block;
}

.hero__title-line--rotator {
  display: block; /* block-level to avoid inline baseline gap */
  line-height: 1.15; /* room for descenders */
  height: 1.15em;
  overflow: hidden;
  white-space: nowrap;
}

.hero__rotator-list {
  display: block;
  transform: translateY(0);
  will-change: transform;
  animation: hero-rotator-7 17.5s linear infinite both;
}

.hero__rotator-item {
  display: block;
  line-height: 1.15; /* match viewport */
  height: 1.15em;
  white-space: nowrap;
  color: rgb(225 29 72); /* rose */
}

@keyframes hero-rotator-7 {
  0% {
    transform: translateY(0);
  }
  11.4286% {
    transform: translateY(0);
  }
  14.2857% {
    transform: translateY(-1.15em);
  }

  25.7143% {
    transform: translateY(-1.15em);
  }
  28.5714% {
    transform: translateY(-2.3em);
  }

  40% {
    transform: translateY(-2.3em);
  }
  42.8571% {
    transform: translateY(-3.45em);
  }

  54.2857% {
    transform: translateY(-3.45em);
  }
  57.1429% {
    transform: translateY(-4.6em);
  }

  68.5714% {
    transform: translateY(-4.6em);
  }
  71.4286% {
    transform: translateY(-5.75em);
  }

  82.8571% {
    transform: translateY(-5.75em);
  }
  85.7143% {
    transform: translateY(-6.9em);
  }

  97.1429% {
    transform: translateY(-6.9em);
  }
  100% {
    transform: translateY(-8.05em);
  } /* ends on duplicate for seamless loop */
}

@media (prefers-reduced-motion: reduce) {
  .hero__rotator-list {
    animation: none;
  }
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .hero__actions {
    flex-direction: row;
  }
}

/* Subheading and description (restored) */
.hero__subtitle {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: rgb(225, 29, 72);
  font-weight: 600;
  font-size: 1.125rem; /* 18px */
}

@media (min-width: 640px) {
  .hero__subtitle {
    font-size: 1.25rem;
  }
}

/* 20px */

.hero__description {
  color: rgb(71, 85, 105);
  font-size: 1.0625rem; /* ~17px */
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 46rem; /* ~736px */
}

/* Visual styles */
.hero__visual {
  position: absolute;
  right: -6vw; /* allow spill into right margin */
  top: 50%;
  transform: translateY(-50%);
  width: 42vw; /* independent of flow */
  max-width: 760px;
  min-width: 420px;
  aspect-ratio: 1/1;
  display: none; /* hidden on small screens */
  background: transparent; /* no gradient background */
  z-index: 5;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .hero__visual {
    display: block;
  }
}

/* Mobile & tablet behavior: hide mascot, show half halo at edge with icons, clip overflow */
@media (max-width: 1023px) {
  .hero {
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .hero__mascot {
    display: none;
  }

  .hero__visual {
    display: block;
    right: -55vw; /* peek from the edge */
    top: 55%;
    transform: translateY(-50%);
    width: 120vw;
    max-width: none;
    min-width: 0;
  }

  .hero__halo {
    width: 70vw;
    height: 70vw;
  }
  .hero__halo::before {
    width: 74vw;
    height: 74vw;
  }
  .hero__halo-outline {
    width: 78vw;
    height: 78vw;
  }
  .hero__halo-outline--2 {
    width: 84vw;
    height: 84vw;
  }
  .hero__halo-outline--3 {
    width: 92vw;
    height: 92vw;
  }
  .hero__shapes {
    display: none;
  }
}

.hero__halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    rgba(225, 29, 72, 0.28) 0%,
    rgba(225, 29, 72, 0.18) 35%,
    rgba(225, 29, 72, 0.08) 60%,
    rgba(225, 29, 72, 0) 70%
  );
  opacity: 0.28; /* lower opacity, no blur */
  pointer-events: none;
  animation: hero-halo-float 18s ease-in-out infinite;
}

.hero__halo::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 450px;
  height: 450px;
  transform: translate(-50%, -50%);
  border-radius: 62% 47% 82% 35% / 45% 45% 80% 66%;
  background: rgba(225, 29, 72, 0.18);
  will-change: border-radius, transform, opacity;
  animation: hero-halo-blob 12s linear infinite;
  display: block;
  opacity: 0.22; /* subtler, more obvious shape change without blur */
  pointer-events: none;
}

.hero__mascot {
  position: absolute;
  left: 55%;
  top: 50%;
  width: 56%;
  max-width: 520px;
  transform: translate(-50%, -50%);
  will-change: transform;
  animation: hero-mascot-float 6.5s ease-in-out infinite;
  margin-left: -12px; /* slight left offset to visually center body */
  z-index: 6; /* ensure above bubbles/halo */
}

@keyframes hero-mascot-float {
  0%,
  100% {
    transform: translate(-50%, -52%) scaleX(-1) scale(1);
  }
  50% {
    transform: translate(-50%, -56%) scaleX(-1) scale(1.01);
  }
}

.hero__shapes {
  position: absolute;
  inset: -5% -10% -5% -5%; /* allow overflow into right margin */
  pointer-events: none;
}

.hero-shape {
  position: absolute;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: #fff;
  background: transparent; /* color via modifier classes */
  border: 1px solid transparent;
  box-shadow: 0 10px 20px -12px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
}

.hero-shape.square {
  border-radius: 0.75rem;
}
.hero-shape.circle {
  border-radius: 9999px;
}

.hero-shape .fa {
  color: #fff;
}

/* Color variants */
.hero-shape.rose {
  background: rgba(225, 29, 72, 0.95);
  border-color: rgba(225, 29, 72, 0.25);
}

.hero-shape.slate {
  background: rgba(71, 85, 105, 0.95);
  border-color: rgba(71, 85, 105, 0.25);
}

/* Rising + pop animation for disappearing bubbles */
@keyframes hero-shape-rise {
  0% {
    transform: translate3d(0, 0, 0) rotate(var(--r0, 0deg));
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  70% {
    transform: translate3d(var(--riseX, 0px), var(--riseY, -120px), 0)
      rotate(var(--r1, 4deg)) scale(1.02);
    opacity: 1;
  }
  85% {
    transform: translate3d(
        calc(var(--riseX, 0px) * 1.1),
        calc(var(--riseY, -120px) - 8px),
        0
      )
      rotate(var(--r1, 4deg)) scale(1.08);
  }
  100% {
    transform: translate3d(
        calc(var(--riseX, 0px) * 1.2),
        calc(var(--riseY, -120px) - 14px),
        0
      )
      rotate(var(--r2, -6deg)) scale(0.6);
    opacity: 0;
  }
}

.hero-shape.animated {
  animation-name: hero-shape-rise;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  will-change: transform, opacity;
}

/* Bobbing shapes that stay visible */
@keyframes hero-shape-bob {
  0% {
    transform: translate3d(0, 0, 0) rotate(var(--rb0, 0deg));
  }
  50% {
    transform: translate3d(0, var(--bob, -14px), 0) rotate(var(--rb1, 4deg));
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--rb2, -4deg));
  }
}

.hero-shape.bobbing {
  animation-name: hero-shape-bob;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  will-change: transform;
  opacity: 1;
}

/* Subtle halo motion */
@keyframes hero-halo-float {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(calc(-50% + 6px), calc(-50% - 6px)) scale(1.03);
    opacity: 0.75;
  }
}

/* Blob-like border-radius morph for halo */
@keyframes hero-halo-blob {
  0%,
  100% {
    border-radius: 60% 40% 72% 28% / 58% 38% 62% 42%;
    transform: translate(-50%, -50%) scale(1) rotateZ(0.01deg);
  }
  34% {
    border-radius: 86% 14% 44% 56% / 26% 21% 79% 74%;
    transform: translate(calc(-50%), calc(-50% + 6px)) scale(1.12)
      rotateZ(0.01deg);
  }
  50% {
    border-radius: 68% 32% 60% 40% / 36% 64% 40% 60%;
    transform: translate(-50%, -50%) scale(1) rotateZ(0.01deg);
  }
  67% {
    border-radius: 94% 66% 66% 94% / 96% 96% 60% 60%;
    transform: translate(calc(-50%), calc(-50% - 6px)) scale(1.14)
      rotateZ(0.01deg);
  }
}

/* Outline that morphs with contrasting, slower timing */
.hero__halo-outline {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 480px;
  height: 480px;
  transform: translate(-50%, -50%);
  border-radius: 60% 40% 72% 28% / 58% 38% 62% 42%;
  border: 2px solid rgba(225, 29, 72, 0.14);
  opacity: 0.24;
  pointer-events: none;
  animation: hero-halo-blob-outline 26s ease-in-out infinite;
}

@keyframes hero-halo-blob-outline {
  0% {
    border-radius: 68% 32% 60% 40% / 36% 64% 40% 60%;
    transform: translate(-50%, -50%) scale(1);
  }
  25% {
    border-radius: 92% 20% 50% 50% / 24% 28% 76% 72%;
    transform: translate(calc(-50% + 4px), calc(-50% + 4px)) scale(1.06);
  }
  50% {
    border-radius: 60% 40% 72% 28% / 58% 38% 62% 42%;
    transform: translate(-50%, -50%) scale(1.02);
  }
  75% {
    border-radius: 96% 68% 66% 90% / 92% 92% 60% 62%;
    transform: translate(calc(-50% - 5px), calc(-50% - 3px)) scale(1.1);
  }
  100% {
    border-radius: 68% 32% 60% 40% / 36% 64% 40% 60%;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Second outline variant with slightly different size, opacity, and timing */
.hero__halo-outline--2 {
  width: 520px;
  height: 520px;
  opacity: 0.28;
  border-color: rgba(225, 29, 72, 0.18);
  animation: hero-halo-blob-outline-2 30s ease-in-out infinite;
}

@keyframes hero-halo-blob-outline-2 {
  0% {
    border-radius: 64% 36% 70% 30% / 54% 46% 60% 40%;
    transform: translate(-50%, -50%) scale(1);
  }
  25% {
    border-radius: 90% 22% 52% 48% / 28% 26% 74% 72%;
    transform: translate(calc(-50% + 6px), calc(-50% + 3px)) scale(1.08);
  }
  50% {
    border-radius: 58% 42% 74% 26% / 60% 40% 60% 40%;
    transform: translate(-50%, -50%) scale(1.02);
  }
  75% {
    border-radius: 98% 70% 68% 92% / 94% 90% 62% 64%;
    transform: translate(calc(-50% - 6px), calc(-50% - 5px)) scale(1.12);
  }
  100% {
    border-radius: 64% 36% 70% 30% / 54% 46% 60% 40%;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Third outline variant for additional depth */
.hero__halo-outline--3 {
  width: 560px;
  height: 560px;
  opacity: 0.22;
  border-color: rgba(225, 29, 72, 0.16);
  animation: hero-halo-blob-outline-3 34s ease-in-out infinite;
}

@keyframes hero-halo-blob-outline-3 {
  0% {
    border-radius: 62% 38% 66% 34% / 56% 44% 64% 36%;
    transform: translate(-50%, -50%) scale(1);
  }
  20% {
    border-radius: 88% 24% 56% 44% / 26% 24% 76% 74%;
    transform: translate(calc(-50% + 4px), calc(-50% + 6px)) scale(1.06);
  }
  50% {
    border-radius: 58% 42% 74% 26% / 60% 40% 60% 40%;
    transform: translate(-50%, -50%) scale(1.02);
  }
  80% {
    border-radius: 96% 70% 70% 94% / 92% 90% 64% 62%;
    transform: translate(calc(-50% - 6px), calc(-50% - 4px)) scale(1.1);
  }
  100% {
    border-radius: 62% 38% 66% 34% / 56% 44% 64% 36%;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__mascot,
  .hero-shape.animated {
    animation: none;
  }
}
