/* ============================================
   ARJUN REALTY - Premium Animations & Effects
   Cinematic Micro-Interactions System
   ============================================ */

/* === Keyframes === */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.8); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(-5px) rotate(-1deg); }
}

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

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes clipReveal {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(212, 168, 83, 0.1); }
    50% { border-color: rgba(212, 168, 83, 0.3); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(212, 168, 83, 0.08); }
    50% { box-shadow: 0 0 50px rgba(212, 168, 83, 0.2); }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

@keyframes typeWriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


/* === Animation States for GSAP ScrollTrigger === */
[data-animate] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

/* Safety: if body gets .loaded class and no GSAP, show content */
body.loaded [data-animate] {
    opacity: 1;
    transform: none;
}

[data-animate="fade-up"].animated,
[data-animate="fade-up"].is-inview {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="fade-right"] {
    transform: translateX(-50px);
}
[data-animate="fade-right"].animated,
[data-animate="fade-right"].is-inview {
    opacity: 1;
    transform: translateX(0);
}

[data-animate="fade-left"] {
    transform: translateX(50px);
}
[data-animate="fade-left"].animated,
[data-animate="fade-left"].is-inview {
    opacity: 1;
    transform: translateX(0);
}

[data-animate="scale-in"] {
    transform: scale(0.92);
}
[data-animate="scale-in"].animated,
[data-animate="scale-in"].is-inview {
    opacity: 1;
    transform: scale(1);
}

[data-animate="clip-reveal"] {
    clip-path: inset(0 100% 0 0);
    opacity: 1;
    transform: none;
}
[data-animate="clip-reveal"].animated {
    clip-path: inset(0 0 0 0);
    transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Text Reveal Animations === */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal .reveal-inner {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.revealed .reveal-inner {
    transform: translateY(0);
}

/* Split text character animation */
.split-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%) rotateX(-90deg);
    transform-origin: bottom;
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-char.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

/* Word-level split animation */
.split-word {
    display: inline-block;
    overflow: hidden;
}

.split-word .word-inner {
    display: inline-block;
    transform: translateY(105%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-word.visible .word-inner {
    transform: translateY(0);
}

/* Line-level animation */
.line-reveal {
    overflow: hidden;
}

.line-reveal .line-inner {
    transform: translateY(100%);
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.line-reveal.visible .line-inner {
    transform: translateY(0);
}


/* === Magnetic Button Effect === */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.magnetic-btn:hover {
    /* Transform applied via JS */
}

.magnetic-btn::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: inherit;
    z-index: -1;
}

/* === Parallax Layers === */
.parallax-container {
    position: relative;
    overflow: hidden;
}

[data-speed] {
    will-change: transform;
}

/* === Lenis Smooth Scroll Integration === */
html.lenis {
    height: auto;
}

html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* === Particle System Styles === */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.particle-glow {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(212, 168, 83, 0.5);
    opacity: 0;
    pointer-events: none;
}

/* === Scroll Progress Bar === */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--gradient-gold);
    z-index: 10000;
    transition: none;
    will-change: width;
}

/* === Card Hover Glow Effect === */
.glow-on-hover {
    position: relative;
    overflow: hidden;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(212, 168, 83, 0.04),
        transparent 40%
    );
    pointer-events: none;
}

.glow-on-hover:hover::before {
    opacity: 1;
}

/* === Stagger Animation Groups === */
.stagger-group > * {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-group.animated > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-group.animated > *:nth-child(1) { transition-delay: 0s; }
.stagger-group.animated > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-group.animated > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-group.animated > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-group.animated > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-group.animated > *:nth-child(6) { transition-delay: 0.5s; }
.stagger-group.animated > *:nth-child(7) { transition-delay: 0.6s; }
.stagger-group.animated > *:nth-child(8) { transition-delay: 0.7s; }


/* === Image & Section Reveal Effects === */
.reveal-mask {
    position: relative;
    overflow: hidden;
}

.reveal-mask::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--dark);
    transform-origin: right;
    transform: scaleX(1);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.reveal-mask.revealed::after {
    transform: scaleX(0);
}

/* Horizontal line reveal */
.line-expand {
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.line-expand.animated {
    width: 100%;
}

/* === Premium Hover Effects === */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
}

.hover-scale {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-scale:hover {
    transform: scale(1.03);
}

.hover-border-glow {
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.hover-border-glow:hover {
    border-color: rgba(212, 168, 83, 0.3);
    box-shadow: 0 0 30px rgba(212, 168, 83, 0.1);
}

/* Underline animation from center */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-underline:hover::after {
    width: 100%;
    left: 0;
}

/* === Loading Shimmer === */
.shimmer-loading {
    background: linear-gradient(
        90deg,
        var(--dark-card) 25%,
        var(--dark-elevated) 50%,
        var(--dark-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite ease-in-out;
}

/* === Cinematic Section Transitions === */
.section-transition-in {
    opacity: 0;
    transform: translateY(60px);
}

.section-transition-in.active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Counter Animation Styles === */
.counter-animate {
    font-variant-numeric: tabular-nums;
    display: inline-block;
    min-width: 1em;
}

/* === Scroll-Triggered Background Shift === */
.bg-shift {
    transition: background-color 0.8s ease;
}

/* === Noise/Grain Overlay === */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    mix-blend-mode: overlay;
    animation: grain 8s steps(10) infinite;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* === Marquee Pause on Hover === */
.clients-marquee:hover .marquee-track {
    animation-play-state: paused;
}

/* === Image Lazy Load Transition === */
img[data-src] {
    opacity: 0;
    transition: opacity 0.6s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* === Focus States for Accessibility === */
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 4px;
}

/* === Smooth Color Transitions === */
.color-transition {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* === 3D Card Tilt Perspective === */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.tilt-card .tilt-content {
    transform: translateZ(30px);
}

/* === Elastic Bounce === */
@keyframes elasticBounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-15px); }
    50% { transform: translateY(-8px); }
    70% { transform: translateY(-12px); }
    100% { transform: translateY(0); }
}

/* === Entrance Sequences for Page Load === */
.entrance-sequence .entrance-item {
    opacity: 0;
    transform: translateY(20px);
}

.entrance-sequence.started .entrance-item {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.entrance-sequence.started .entrance-item:nth-child(1) { animation-delay: 0.1s; }
.entrance-sequence.started .entrance-item:nth-child(2) { animation-delay: 0.2s; }
.entrance-sequence.started .entrance-item:nth-child(3) { animation-delay: 0.3s; }
.entrance-sequence.started .entrance-item:nth-child(4) { animation-delay: 0.4s; }
.entrance-sequence.started .entrance-item:nth-child(5) { animation-delay: 0.5s; }
.entrance-sequence.started .entrance-item:nth-child(6) { animation-delay: 0.6s; }
