@keyframes logo-reveal {
  from {
    filter: blur(14px);
    transform: scale(0.72);
    opacity: 0;
  }
  to {
    filter: blur(0);
    transform: scale(1);
    opacity: 1;
  }
}

.site-logo {
  animation: logo-reveal 0.9s ease-out forwards;
}

html, body {
  overflow-x: hidden;
}

.xperience-gallery {
  margin: 3rem 0 5rem;
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.xperience-row {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  min-height: 520px;
}

.xperience-row:not(.in-view) .xperience-img,
.xperience-row:not(.in-view) .xperience-card-wrapper {
  display: none;
}

.xperience-row:nth-child(even) {
  flex-direction: row-reverse;
}

.xperience-img {
  width: 450px;
  height: 520px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center center;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(46, 29, 16, 0.12);
}

.xperience-card-wrapper {
  flex: 1;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
}

/* --- Slide-in animations --- */
@keyframes from-left {
  from { opacity: 0; transform: translateX(-100px); }
  to   { opacity: 1; transform: translateX(0px); }
}

@keyframes from-right {
  from { opacity: 0; transform: translateX(100px); }
  to   { opacity: 1; transform: translateX(0px); }
}

@keyframes from-bottom {
  from { opacity: 0; transform: translateY(100px); }
  to   { opacity: 1; transform: translateY(0px); }
}

/* Paused by default — JS adds .in-view to trigger the animation */
.xperience-row:nth-child(odd) .xperience-img {
  animation-name: from-left;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
  animation-play-state: paused;
}
.xperience-row:nth-child(odd) .xperience-card-wrapper {
  animation-name: from-right;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-delay: 0.15s;
  animation-fill-mode: both;
  animation-play-state: paused;
}
.xperience-row:nth-child(even) .xperience-img {
  animation-name: from-right;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
  animation-play-state: paused;
}
.xperience-row:nth-child(even) .xperience-card-wrapper {
  animation-name: from-left;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-delay: 0.15s;
  animation-fill-mode: both;
  animation-play-state: paused;
}

.xperience-row .objetivo-card {
  animation-name: from-bottom;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-delay: 0.35s;
  animation-fill-mode: both;
  animation-play-state: paused;
}

@keyframes flower-pop {
  from { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.2);  opacity: 1; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Same specificity as the rules above, but appears later → wins */
.xperience-row.in-view .xperience-img,
.xperience-row.in-view .xperience-card-wrapper,
.xperience-row.in-view .objetivo-card,
.xperience-row.in-view .quote-card,
.xperience-row.in-view .quote-card__flower {
  animation-play-state: running;
}

.xperience-row .quote-card__flower {
  animation-name: flower-pop;
  animation-duration: 0.45s;
  animation-timing-function: ease-out;
  animation-delay: 0.9s;
  animation-fill-mode: both;
  animation-play-state: paused;
}

/* --- Quote card --- */
.quote-card {
  position: relative;
  background: var(--color-bg-highlight);
  border: 2.5px solid var(--color-text);
  padding: 1.75rem 2.5rem;
  text-align: center;
  box-shadow: 18px -18px 0 0 var(--color-box), 18px -18px 0 2.5px #924519;
}

.quote-card p {
  font-family: 'Calistoga', cursive;
  font-size: clamp(1.1rem, 1.8vw, 1rem);
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}

.quote-card__flower {
  position: absolute;
  width: 68px;
  height: 68px;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.quote-card__flower--tr {
  top: -28px;
  right: -22px;
}

.quote-card__flower--bl {
  bottom: -28px;
  left: -22px;
}

/* Image on the right → invert flower corners */
.xperience-row:nth-child(even) .quote-card__flower--tr {
  right: auto;
  left: -22px;
}

.xperience-row:nth-child(even) .quote-card__flower--bl {
  left: auto;
  right: -22px;
}

.xperience-row .quote-card {
  animation-name: from-bottom;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-delay: 0.55s;
  animation-fill-mode: both;
  animation-play-state: paused;
}

/* --- Infinite carousel --- */
@keyframes carousel-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-33.333%); }
}

.carousel-title {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem 1rem;
  font-family: 'Calistoga', cursive;
  font-size: 2.5rem;
  color: var(--color-text);
}

.xperience-carousel {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  padding: 2rem 0;
}

.carousel-track {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  animation: carousel-scroll 80s linear infinite;
}

.carousel-track img {
  height: 340px;
  width: 340px;
  flex-shrink: 0;
  border-radius: var(--radius);
  object-fit: cover;
}

/* --- Community hero --- */
@keyframes float-up {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0;
  }
  5% {
    opacity: 0.85;
  }
  20% {
    transform: translateY(-70px) translateX(-6px) scale(0.9);
    opacity: 0.9;
  }
  40% {
    transform: translateY(-150px) translateX(6px) scale(0.95);
    opacity: 0.75;
  }
  60% {
    transform: translateY(-230px) translateX(-5px) scale(0.85);
    opacity: 0.5;
  }
  80% {
    transform: translateY(-310px) translateX(4px) scale(0.7);
    opacity: 0.25;
  }
  100% {
    transform: translateY(-400px) translateX(-3px) scale(0.55);
    opacity: 0;
  }
}

.community-hero {
  text-align: center;
  padding: 4rem 2rem;
  background: color(srgb 0.95 0.87 0.73 / 0.50);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.highlight-banner {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 4rem 0;
  padding-inline: 2rem;
  position: relative;
  z-index: 0;
}

.highlight-banner::before {
  content: '';
  position: absolute;
  inset: -2rem 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  background: color-mix(in srgb, var(--color-box) 20%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: -1;
}

.highlight-banner > img {
  width: 50%;
  max-height: 300px;
  border-radius: var(--radius);
  object-fit: cover;
}

.highlight-banner .quote-card {
  flex: 1;
}

.conclusion--with-video {
  flex-direction: row;
  text-align: left;
  align-items: stretch;
  background: color(srgb 0.95 0.87 0.73 / 0.50);
}

.conclusion__video {
  border-radius: var(--radius);
  flex-shrink: 0;
  max-width: 100%;
}

.conclusion__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

@media (max-width: 768px) {
  .conclusion--with-video {
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0 0;
  }

  .conclusion__content {
    padding: 1.5rem;
  }

  .highlight-banner {
    flex-direction: column;
  }

  .highlight-banner > img {
    width: 100%;
  }

  .conclusion__video {
    width: 100%;
    max-width: 325px;
  }
}

.community-wrapper {
  position: relative;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 5rem 0 5rem;
}

.like-btn {
  position: absolute;
  bottom: 1.2rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  color: var(--color-text);
  z-index: 3;
  animation: pulse-like 1.4s ease-in-out infinite;
}

@keyframes pulse-like {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25); }
}

.community-hero::after,
.floating-logo {
  content: '';
  position: absolute;
  bottom: 1.2rem;
  right: 1.5rem;
  width: 45px;
  height: 45px;
  background: url('../styles/logos/icono.png') center/contain no-repeat;
  border-radius: 50%;
  animation: float-up 4s linear infinite;
  pointer-events: none;
  z-index: 4;
}

.floating-logo:nth-child(1) {
  animation-delay: 1.4s;
  width: 38px;
  height: 38px;
  right: 2.5rem;
}

.floating-logo:nth-child(2) {
  animation-delay: 2.8s;
  width: 40px;
  height: 40px;
  right: 0.8rem;
}

.community-content {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.community-gif {
  width: 250px;
  height: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
}

.community-hero h2 {
  font-family: 'Calistoga', cursive;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
}

.community-hero p {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.community-socials {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.community-socials a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  text-decoration: none;
  font-family: 'Young Serif', serif;
  font-size: 1.1rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.community-socials a:hover {
  transform: scale(1.15);
}

.community-socials svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 850px) {
  .xperience-row {
    min-height: 400px;
  }

  .xperience-row,
  .xperience-row:nth-child(even) {
    flex-direction: column;
    gap: 2rem;
    padding: 1rem;
  }

  .xperience-img {
    width: 100%;
    max-width: 45rem;
    height: 400px;
    margin: 0 auto;
  }

  .xperience-gallery {
    margin: 3rem 0 0rem;
  }

  .xperience-card-wrapper {
    width: 100%;
    padding: 1.5rem 1rem;
    gap: 3.5rem;
  }

  .carousel-title {
    font-size: 1.6rem;
  }

  .carousel-track img {
    height: 250px;
    width: 250px;
  }

  .community-wrapper {
    margin: 2rem 0;
  }
}
