/* ============================================
   Jovi Products — Animation System
   ============================================ */

:root {
  --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 0.4s;
  --duration-medium: 0.8s;
  --duration-slow: 1.2s;
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .page-loader { display: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
  .hero-word, .hero-tagline, .hero-sub, .hero-btn-wrap, .hero-scroll { opacity: 1 !important; transform: none !important; }
}

/* ---- Page loader ---- */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-charcoal);
  transition: opacity 0.6s var(--ease-luxury), visibility 0.6s;
}

.page-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--color-sage-light), var(--color-citrus-light));
  transition: width 1.4s var(--ease-luxury);
}

.page-loader.loading .page-loader-bar {
  width: 100%;
}

.loader-text {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.3em;
  color: var(--color-cream);
  opacity: 0;
  transform: translateY(12px);
  animation: loaderTextIn 0.8s var(--ease-luxury) 0.2s forwards;
}

@keyframes loaderTextIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Scroll reveal base ---- */

[data-reveal] {
  opacity: 0;
  will-change: transform, opacity, filter;
  transition:
    opacity var(--duration-medium) var(--ease-luxury),
    transform var(--duration-medium) var(--ease-luxury),
    filter var(--duration-medium) var(--ease-luxury);
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

[data-reveal="fade-up"] {
  transform: translateY(48px);
  filter: blur(6px);
}

[data-reveal="fade-down"] {
  transform: translateY(-32px);
  filter: blur(4px);
}

[data-reveal="fade-left"] {
  transform: translateX(-40px);
  filter: blur(4px);
}

[data-reveal="fade-right"] {
  transform: translateX(40px);
  filter: blur(4px);
}

[data-reveal="scale-up"] {
  transform: scale(0.92);
  filter: blur(8px);
}

[data-reveal="clip-up"] {
  clip-path: inset(100% 0 0 0);
  opacity: 1;
  transform: none;
  filter: none;
  transition: clip-path var(--duration-slow) var(--ease-luxury);
}

[data-reveal="clip-up"].revealed {
  clip-path: inset(0 0 0 0);
}

/* Stagger delays via JS --delay custom property */
[data-reveal] {
  transition-delay: var(--delay, 0s);
}

/* ---- Hero ---- */

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: orbFadeIn 1.8s var(--ease-luxury) forwards;
}

.hero-orb--1 {
  width: 420px;
  height: 420px;
  background: rgba(155, 138, 184, 0.35);
  top: 10%;
  left: -8%;
  animation-delay: 0.3s;
}

.hero-orb--2 {
  width: 320px;
  height: 320px;
  background: rgba(212, 200, 228, 0.5);
  bottom: 15%;
  right: -5%;
  animation-delay: 0.5s;
}

.hero-orb--3 {
  width: 200px;
  height: 200px;
  background: rgba(139, 111, 160, 0.25);
  top: 40%;
  right: 20%;
  animation-delay: 0.7s;
}

@keyframes orbFadeIn {
  to { opacity: 1; }
}

.hero-orb {
  animation: orbFadeIn 1.8s var(--ease-luxury) forwards, orbFloat 12s ease-in-out infinite;
}

.hero-orb--1 { animation-delay: 0.3s, 0s; }
.hero-orb--2 { animation-delay: 0.5s, 2s; }
.hero-orb--3 { animation-delay: 0.7s, 4s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

.hero-content .hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  clip-path: inset(0 0 100% 0);
  animation: heroWordReveal 1s var(--ease-luxury) forwards;
  animation-delay: calc(0.8s + var(--i, 0) * 0.12s);
}

@keyframes heroWordReveal {
  to {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0 0);
  }
}

.hero-tagline,
.hero-sub {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(4px);
  animation: heroFadeUp 0.9s var(--ease-luxury) forwards;
}

.hero-tagline { animation-delay: 1.2s; }
.hero-sub { animation-delay: 1.35s; }

@keyframes heroFadeUp {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-btn-wrap {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  animation: heroBtnIn 0.8s var(--ease-spring) 1.5s forwards;
}

@keyframes heroBtnIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-scroll {
  opacity: 0;
  animation: heroFadeUp 0.8s var(--ease-luxury) 1.8s forwards;
}

.site-header {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.8s var(--ease-luxury), transform 0.8s var(--ease-luxury), background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

body.loaded .site-header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1s;
}

body.loaded .site-header.header-hidden {
  transform: translateY(-100%);
  transition-delay: 0s;
}

/* ---- Section title line draw ---- */

.section-header {
  position: relative;
}

.title-line {
  display: block;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-sage), transparent);
  margin-top: 1rem;
  transition: width 1s var(--ease-luxury);
}

.section-header.revealed .title-line,
.section-header.centered.revealed .title-line {
  width: 60px;
}

.section-header.centered .title-line {
  margin-inline: auto;
}

/* ---- Nav link underline ---- */

.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-sage-dark);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-luxury);
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---- Approach cards ---- */

.approach-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.5s var(--ease-luxury),
    box-shadow 0.5s var(--ease-luxury);
}

.approach-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(155, 138, 184, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-luxury);
}

.approach-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(92, 74, 114, 0.12);
}

.approach-card:hover::before {
  opacity: 1;
}

.approach-card h3 {
  transition: letter-spacing 0.5s var(--ease-luxury);
}

.approach-card:hover h3 {
  letter-spacing: 0.08em;
}

/* ---- Product cards 3D ---- */

.product-card {
  perspective: 800px;
}

.product-image-wrap {
  transform-style: preserve-3d;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.5s var(--ease-luxury);
}

.product-image-wrap img {
  transition: transform 0.6s var(--ease-luxury);
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.06);
}

.product-card h4 {
  transition: color 0.4s var(--ease-luxury), letter-spacing 0.4s var(--ease-luxury);
}

.product-card:hover h4 {
  color: var(--color-sage-dark);
  letter-spacing: 0.1em;
}

.product-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4) 0%,
    transparent 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.5s var(--ease-luxury);
  pointer-events: none;
}

.product-card:hover .product-image-wrap::after {
  opacity: 1;
}

/* ---- Buttons ---- */

.btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-sage), var(--color-citrus));
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease-luxury);
  z-index: -1;
}

.btn-primary:hover::before {
  transform: translateX(0);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(92, 74, 114, 0.3);
}

/* ---- Contact card shimmer ---- */

.contact-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.6s var(--ease-luxury), box-shadow 0.6s var(--ease-luxury);
}

.contact-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(155, 138, 184, 0.06), transparent 30%);
  animation: contactShimmer 8s linear infinite;
  pointer-events: none;
}

@keyframes contactShimmer {
  to { transform: rotate(360deg); }
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(92, 74, 114, 0.12);
}

.contact-link {
  position: relative;
  display: inline-block;
}

.contact-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-luxury);
}

.contact-link:hover::after {
  transform: scaleX(1);
}

/* ---- Footer ---- */

.site-footer {
  position: relative;
  overflow: hidden;
}

.footer-inner > * {
  transition: transform 0.5s var(--ease-luxury), opacity 0.5s var(--ease-luxury);
}

/* ---- Lightbox enhanced ---- */

.lightbox {
  backdrop-filter: blur(0px);
  transition:
    opacity 0.5s var(--ease-luxury),
    visibility 0.5s,
    backdrop-filter 0.5s var(--ease-luxury);
}

.lightbox.active {
  backdrop-filter: blur(12px);
}

.lightbox-content img {
  transform: scale(0.9);
  opacity: 0;
  transition:
    transform 0.5s var(--ease-spring),
    opacity 0.4s var(--ease-luxury);
}

.lightbox.active .lightbox-content img.loaded {
  transform: scale(1);
  opacity: 1;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s var(--ease-luxury), transform 0.4s var(--ease-spring);
}

.lightbox.active .lightbox-close,
.lightbox.active .lightbox-prev,
.lightbox.active .lightbox-next {
  opacity: 0.7;
  transform: scale(1);
}

.lightbox.active .lightbox-prev,
.lightbox.active .lightbox-next {
  transform: translateY(-50%) scale(1);
}

.lightbox-caption {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.5s var(--ease-luxury) 0.2s, opacity 0.5s var(--ease-luxury) 0.2s;
}

.lightbox.active .lightbox-caption.visible {
  transform: translateY(0);
  opacity: 0.8;
}

/* ---- Category divider ---- */

.product-category {
  position: relative;
}

.category-divider {
  display: block;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-sage-light), transparent);
  margin-bottom: var(--space-md);
  transition: width 1.2s var(--ease-luxury);
}

.product-category.revealed .category-divider {
  width: 100%;
}

/* ---- Parallax sections ---- */

.hero-bg {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ---- Mobile nav animation ---- */

.nav-links.open li {
  animation: navSlideIn 0.5s var(--ease-luxury) forwards;
  opacity: 0;
  transform: translateX(20px);
}

.nav-links.open li:nth-child(1) { animation-delay: 0.05s; }
.nav-links.open li:nth-child(2) { animation-delay: 0.1s; }
.nav-links.open li:nth-child(3) { animation-delay: 0.15s; }
.nav-links.open li:nth-child(4) { animation-delay: 0.2s; }
.nav-links.open li:nth-child(5) { animation-delay: 0.25s; }

@keyframes navSlideIn {
  to { opacity: 1; transform: translateX(0); }
}

.nav-toggle.open span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle.open span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}
