:root {
  --background: 252 100% 98.04%;
  --foreground: 240 24.39% 16.08%;
  --card: 0 0% 100%;
  --card-foreground: 240 24.39% 16.08%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 24.39% 16.08%;
  --primary: 246.81 92.16% 70%;
  --primary-soft: 249 100% 92%;
  --primary-dark: 246.81 92.16% 48%;
  --primary-foreground: 0 0% 100%;
  --secondary: 248.33 100% 92.94%;
  --secondary-foreground: 240 24.39% 16.08%;
  --muted: 248.33 100% 92.94%;
  --muted-foreground: 240 12.93% 45.49%;
  --accent: 319.09 64.71% 86.67%;
  --accent-foreground: 240 24.39% 16.08%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 100%;
  --border: 246.67 100% 94.71%;
  --input: 246.67 100% 94.71%;
  --ring: 246.81 92.16% 70%;
  --radius: 1rem;
  --sidebar-background: 252 100% 98.04%;
  --sidebar-foreground: 240 24.39% 16.08%;
  --sidebar-primary: 246.81 92.16% 70%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 248.33 100% 92.94%;
  --sidebar-accent-foreground: 240 24.39% 16.08%;
  --sidebar-border: 246.67 100% 94.71%;
  --sidebar-ring: 246.81 92.16% 70%;
}

.dark {
  --background: 247.5 41.38% 11.37%;
  --foreground: 0 0% 98%;
  --card: 247.74 36.47% 16.67%;
  --card-foreground: 0 0% 98%;
  --popover: 247.74 36.47% 16.67%;
  --popover-foreground: 0 0% 98%;
  --primary: 246.81 92.16% 70%;
  --primary-soft: 248 52% 32%;
  --primary-dark: 246.81 65% 40%;
  --primary-foreground: 0 0% 100%;
  --secondary: 249 35.09% 22.35%;
  --secondary-foreground: 0 0% 98%;
  --muted: 249 35.09% 22.35%;
  --muted-foreground: 246.67 33% 70%;
  --accent: 319.09 64.71% 86.67%;
  --accent-foreground: 240 24.39% 16.08%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 100%;
  --border: 246.98 33.86% 24.9%;
  --input: 246.98 33.86% 24.9%;
  --ring: 246.81 92.16% 70%;
  --sidebar-background: 247.74 36.47% 16.67%;
  --sidebar-foreground: 0 0% 96%;
  --sidebar-primary: 246.81 92.16% 70%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 249 35.09% 22.35%;
  --sidebar-accent-foreground: 0 0% 96%;
  --sidebar-border: 246.98 33.86% 24.9%;
  --sidebar-ring: 246.81 92.16% 70%;
}

.pulse-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  --pulse-diameter: clamp(36rem, 120vmax, 120rem);
  width: var(--pulse-diameter);
  height: var(--pulse-diameter);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  border-radius: 9999px;
}

.hero-pulse {
  --pulse-diameter: clamp(40rem, 130vmax, 130rem);
}

@media (max-width: 1024px) {
  .hero-pulse {
    --pulse-diameter: clamp(32rem, 140vmax, 110rem);
  }
}

@media (max-width: 640px) {
  .hero-pulse {
    --pulse-diameter: clamp(26rem, 160vmax, 90rem);
  }
}

.pulse-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(8rem, 28vw, 16rem);
  height: clamp(8rem, 28vw, 16rem);
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.18), hsl(var(--accent) / 0.12));
  box-shadow: 0 24px 48px hsl(var(--primary) / 0.22);
  opacity: 0.9;
  filter: blur(0);
}

.pulse-circle {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: radial-gradient(circle, hsl(var(--primary) / 0.2) 0%, hsl(var(--primary) / 0) 70%);
  box-shadow: 0 24px 48px hsl(var(--primary) / 0.22);
  animation: pulseWave 6s ease-out infinite;
  opacity: 0;
  will-change: transform, opacity;
}

.pulse-circle.pulse-delay-1 {
  animation-delay: 2s;
}

.pulse-circle.pulse-delay-2 {
  animation-delay: 4s;
  background: radial-gradient(circle, hsl(var(--accent) / 0.18) 0%, hsl(var(--accent) / 0) 70%);
}

@keyframes pulseWave {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }

  50% {
    opacity: 0.25;
  }

  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* .hero-overlap,
.features-overlap {
  isolation: isolate;
} */

.problem-section {
  position: relative;
  z-index: 10;
  margin-top: -6rem;
  margin-bottom: -6rem;
  padding: 6rem 0;
  background: linear-gradient(135deg, hsl(var(--primary-soft)), hsl(var(--primary-soft)));
  border-radius: 3rem;
  box-shadow: 0 20px 50px hsl(var(--primary) / 0.15);
  overflow: visible;
}

.hero-overlap::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12rem;
  width: 120vw;
  height: 20rem;
  transform: translateX(-50%);
  background: inherit;
  z-index: -1;
  pointer-events: none;
}

.features-overlap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -12rem;
  width: 120vw;
  height: 20rem;
  transform: translateX(-50%);
  background: inherit;
  z-index: -1;
  pointer-events: none;
}

.problem-section h2 {
  color: hsl(var(--primary-foreground));
}

.problem-inner {
  position: relative;
  z-index: 2;
}

#hero,
.solution-section {
  position: relative;
  z-index: 1;
}

#hero {
  padding-bottom: 6rem;
}

.problem-card {
  aspect-ratio: 2 / 3;
  min-height: clamp(240px, 20vw, 420px);
  width: 100%;
  min-width: 250px;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  cursor: pointer;
  border-radius: 1.75rem;
  outline: none;
}

.problem-card:focus-visible {
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.35);
}

.problem-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 1.75rem;
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
  transform-origin: center;
  will-change: transform;
}

.problem-card-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid hsl(var(--border));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  backface-visibility: hidden;
  transform-origin: center;
}

.problem-card-face > * {
  transform: translateZ(2px);
}

.problem-card-front {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: rotateY(0deg);
}

.problem-card-back {
  background: linear-gradient(135deg, hsl(var(--primary-soft)), hsl(var(--primary) / 0.6));
  color: hsl(var(--primary-foreground));
  transform: rotateY(180deg);
}

.problem-card-back p {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
}

.problem-card.is-flipped .problem-card-inner {
  transform: rotateY(180deg);
}

.problem-card-label {
  background-color: rgba(7, 8, 14, 0.3);
  border-radius: 1.5rem;
  padding: 0.625rem 1.25rem;
  box-shadow: 0 15px 35px rgba(3, 4, 10, 0.4);
  backdrop-filter: blur(6px);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 0 auto;
  max-width: min(90%, 26rem);
}

@media (max-width: 1200px) {
  .problem-grid {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
  }

  .problem-card {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 640px) {
  .problem-grid {
    max-width: none;
    grid-template-columns: 1fr;
  }

  .problem-card {
    max-width: none;
  }
}

.solution-section {
  position: relative;
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
  background-color: hsl(var(--background));
  background-image: linear-gradient(90deg, hsl(var(--background)) 0%, hsl(var(--background)) 45%, hsl(var(--background) / 0.9) 60%, transparent 78%);
  background-size: 100% 100%;
  background-position: left center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  padding-top: 22rem;
  margin-top: 0;
}

.solution-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    hsl(var(--background)) 0%,
    hsl(var(--background)) 40%,
    hsl(var(--background) / 0.95) 52%,
    hsl(var(--background) / 0.7) 65%,
    hsl(var(--background) / 0.35) 75%,
    transparent 88%
  );
  z-index: 0;
  pointer-events: none;
}

.solution-section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  right: 0;
  background-image: url("../assets/coach2.png");
  background-repeat: no-repeat;
  background-size: auto 110%;
  background-position: right center;
  background-attachment: fixed;
  opacity: 0.95;
  filter: none;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 1) 35%, rgba(0, 0, 0, 1) 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 1) 35%, rgba(0, 0, 0, 1) 100%);
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .solution-section::after {
    display: none;
  }
}

.solution-layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(2rem, 4vw, 4.5rem);
}

@media (min-width: 1024px) {
  .solution-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }
}

.solution-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 3.5rem);
  margin-top: clamp(2rem, 4vw, 3.5rem);
}

.solution-card {
  position: relative;
  padding: clamp(0.75rem, 2vw, 1.5rem) 0;
}

.solution-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 2px;
  background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--accent)));
  opacity: 0.35;
  filter: blur(0.5px);
}

.solution-card-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 2vw, 2.5rem);
  align-items: flex-start;
  padding-left: clamp(1.5rem, 4vw, 2.75rem);
  background: transparent;
}

.solution-card-index {
  width: clamp(3.25rem, 6vw, 4rem);
  height: clamp(3.25rem, 6vw, 4rem);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 700;
  color: hsl(var(--primary-foreground));
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-soft)));
  box-shadow: 0 15px 35px hsl(var(--primary) / 0.3);
  letter-spacing: -0.03em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.solution-card-content {
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 1.4vw, 1.5rem);
  align-items: flex-start;
}

.solution-card-copy {
  display: grid;
  gap: clamp(0.85rem, 1.5vw, 1.6rem);
}

.solution-card-title {
  font-size: clamp(2.35rem, 4vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: hsl(var(--foreground));
  text-shadow: 0 12px 30px hsl(var(--background) / 0.85);
  transition: color 0.3s ease, transform 0.3s ease;
}

.solution-card-text {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: hsl(var(--muted-foreground));
}

.solution-card:hover .solution-card-index {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 20px 45px hsl(var(--primary) / 0.45);
}

.solution-card:hover .solution-card-title {
  color: hsl(var(--primary));
  transform: translateX(4px);
}
