/* Animation styles for Holistic Training Builder */

/* Base animation classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delay variations for staggered animations */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }

/* Image and video animations */
.image-animation, .video-animation {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1s ease, transform 1s ease;
}

.image-animation.visible, .video-animation.visible {
  opacity: 1;
  transform: scale(1);
}

/* Full-width, edge-to-edge media on mobile (no frame/padding/radius) */
@media (max-width: 767px) {
  body {
    overflow-x: clip;
  }

  .video-animation:has(> video):not(.intro-hero-video),
  .video-frame:not(.intro-hero-video) {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
  }

  .video-animation:has(> video):not(.intro-hero-video) > video,
  .video-frame:not(.intro-hero-video) > video {
    border-radius: 0 !important;
  }

  .video-animation:has(> .video-animation > video),
  .video-frame-outer {
    padding: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
  }

  .image-animation:has(> img) {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
  }

  .image-animation:has(> img) > img {
    border-radius: 0 !important;
  }
}

/* Other Projects, last section; skip scroll fade so heading/cards stay visible */
#next-project .section-heading {
  opacity: 1;
  transform: translateY(0);
}

#next-project-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2rem;
  width: 100%;
  overflow-x: visible;
}

.next-project-card {
  flex: 1 1 100%;
  min-width: 0;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
}

.next-project-card__link {
  display: block;
  width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.next-project-card__direction {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  color: #a1a1aa;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.next-project-card__copy {
  display: flex;
  flex-flow: column nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.375rem;
  flex: 1 1 0;
  min-width: 0;
}

.next-project-card__body {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.next-project-card__thumb {
  position: relative;
  flex: 0 0 6.5rem;
  width: 6.5rem;
  height: 5.25rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.next-project-card__thumb video,
.next-project-card__thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.next-project-card__title {
  width: 100%;
  margin: 0;
  color: #09090b;
  font-size: 0.9375rem;
  font-weight: 900;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .next-project-card {
    flex: 1 1 calc(50% - 1rem);
    padding: 2rem;
  }

  .next-project-card__body {
    gap: 2rem;
  }

  .next-project-card__copy {
    gap: 0.5rem;
  }

  .next-project-card__direction {
    font-size: 0.8125rem;
  }

  #next-project-cards.next-project-cards--next-only {
    justify-content: center;
  }

  #next-project-cards.next-project-cards--next-only .next-project-card {
    flex: 1 1 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
  }

  .next-project-card__thumb {
    width: 10rem;
    height: 7rem;
  }

  .next-project-card__title {
    font-size: 1.125rem;
    line-height: 1.5rem;
  }
}

/* Other Projects card titles, smaller on mobile */
@media (max-width: 767px) {
  #next-project {
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
    overflow-x: visible;
  }

  #next-project-cards {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }
}

/* Section heading animations */
.section-heading {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-heading.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Feature header row: title left, description right */
.feature-header-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

@media (min-width: 768px) {
  .feature-header-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
  }

  .feature-header-row__title {
    flex: 0 0 auto;
    width: 42%;
    max-width: 42%;
    text-align: left !important;
    margin-bottom: 0 !important;
  }

  .feature-header-row__text {
    flex: 0 0 auto;
    width: 50%;
    max-width: 50%;
    text-align: left !important;
    margin-bottom: 0 !important;
    font-size: 1.125rem;
    line-height: 1.625;
  }
}

.feature-header-row__text {
  font-size: 1rem;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .feature-header-row__title {
    width: 100%;
    max-width: 100%;
  }

  .feature-header-row__title br {
    display: none;
  }
}

/* Section labels (DISCOVERY, DESIGN PROCESS, etc.) */
@media (max-width: 767px) {
  .text-center > h2.section-heading {
    text-align: left;
  }

  h2.section-heading.inline-block,
  h3.section-heading.inline-block {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }
}

/* Card animations */
.card-animation {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.card-animation.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation for list items */
.list-animation li {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.list-animation li.visible {
  opacity: 1;
  transform: translateY(0);
}

.list-animation li:nth-child(1) { transition-delay: 0.1s; }
.list-animation li:nth-child(2) { transition-delay: 0.2s; }
.list-animation li:nth-child(3) { transition-delay: 0.3s; }
.list-animation li:nth-child(4) { transition-delay: 0.4s; }
.list-animation li:nth-child(5) { transition-delay: 0.5s; }

/* Animation styles for project pages */

/* Like Button Animation */
:root {
  --color-heart: #EA442B;
  --easing: cubic-bezier(.7,0,.3,1);
  --duration: .5s;
}

.like-button {
  position: relative;
  z-index: 2;
  transition: transform var(--duration) var(--easing);
  cursor: pointer;
  overflow: visible;
}

.like-button:before {
  z-index: -1;
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: inherit;
}

.like-button:active:before {
  animation: depress-shadow var(--duration) var(--easing) both;
}

.like-button.active:after {
  animation: depress var(--duration) var(--easing) both;
}

@keyframes depress {
  from, to { transform: none; }
  50% { transform: translateY(5%) scale(0.98); }
}

@keyframes depress-shadow {
  from, to { transform: none; }
  50% { transform: scale(0.95); }
}

.like-wrapper {
  display: grid;
  align-items: center;
  justify-content: center;
  z-index: 1;
  width: 24px;
  height: 24px;
}

.like-wrapper > * {
  margin: auto;
  grid-area: 1 / 1;
}

.heart {
  display: block;
  transform-origin: center 80%;
}

.heart > path {
  stroke: white;
  stroke-width: 2;
  fill: transparent !important;
  transition: fill var(--duration) var(--easing);
}

/* Keep heart filled when liked */
.like-button.liked .heart > path {
  fill: white !important;
}

.like-button.active .heart > path {
  fill: white !important;
}

.like-button.active .heart {
  animation: heart-bounce var(--duration) var(--easing);
}

@keyframes heart-bounce {
  40% { transform: scale(0.7); }
  0%, 80%, 100% { transform: scale(1); }
}

/* Added wrapper to prevent layout jank with resizing particles */
.particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
}

.particle {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 0.1em;
  width: 0.1em;
  border-radius: 0.05em;
  background-color: var(--color);
  --percentage: calc(var(--i) / var(--total-particles));
  --Θ: calc(var(--percentage) * 1turn);
  transform: translate(-50%, -50%) rotate(var(--Θ)) translateY(0) scaleY(0);
  transition: all var(--duration) var(--easing);
}

.like-button.active .particle {
  animation: particles-out calc(var(--duration) * 1.2) var(--easing) forwards;
}

@keyframes particles-out {
  50% { height: 0.3em; }
  50%, 60% {
    height: 0.3em;
    transform: translate(-50%, -50%) rotate(var(--Θ)) translateY(1.8em) scale(1);
  }
  60% { height: 0.2em; }
  100% {
    transform: translate(-50%, -50%) rotate(var(--Θ)) translateY(2.5em) scale(0);
  }
}

.ripple {
  position: absolute;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  top: 0;
  left: 0;
}

.ripple:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0.4em solid white;
  border-radius: inherit;
  transform: scale(0);
}

.like-button.active .ripple:before {
  animation: ripple-out var(--duration) var(--easing);
}

@keyframes ripple-out {
  from { transform: scale(0); }
  to { transform: scale(2); }
} 


/* Aurora animation styles */
:root {
  --clr-1: #FFF600; /* yellow */
  --clr-2: #000000; /* black */
  --clr-3: #959595; /* medium gray */
  --clr-4: #ffffff; /* medium gray */
}

.logo-aurora {
  position: relative;
  display: inline-block;
  font-weight: 300;
  background: transparent;
}

.logo-aurora span {
  position: relative;
  z-index: 10;
  background-image: linear-gradient(
    90deg, 
    var(--clr-1) 0%, 
    var(--clr-3) 33%, 
    var(--clr-2) 67%, 
    var(--clr-1) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: aurora-text 8s linear infinite;
  background-size: 400% 100%;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

.aurora {
  display: none;
}

@keyframes aurora-text {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Floating close button, visible only after navbar scrolls away */
.back-home {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: rgb(119 119 119 / 58%);
  color: white;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000020;
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.back-home i {
  display: inline-block;
  line-height: 1;
}

.back-home:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.back-home:hover i {
  animation: back-home-spin 0.45s ease;
}

.back-home.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-home.visible:hover {
  transform: scale(1.1);
}

@keyframes back-home-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
