/* =========================================
   PREMIUM EFFECTS - CLEAN VERSION
   Uses Theme System Variables for all colors
   ========================================= */

/* ===========================================
   1. GLASSMORPHIC / NEOMORPHIC BUTTONS
   =========================================== */

/* Unified Neomorphic Button Style */
.btn.neomorphic,
.btn-neomorphic,
.btn.primary,
.btn.secondary {
    position: relative;
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--btn-neomorphic-text);
    background: var(--btn-neomorphic-bg);
    border: 1px solid var(--btn-neomorphic-border);
    border-radius: 20px;
    box-shadow: var(--btn-neomorphic-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    letter-spacing: 0.01em;
}

/* Hover State */
.btn.neomorphic:hover,
.btn-neomorphic:hover,
.btn.primary:hover,
.btn.secondary:hover {
    transform: translateY(-2px);
    background: var(--btn-neomorphic-bg);
    /* Kept same, shadow does the work */
    box-shadow: var(--btn-neomorphic-shadow-hover);
    color: var(--btn-neomorphic-text);
}

/* Active State */
.btn.neomorphic:active,
.btn-neomorphic:active,
.btn.primary:active,
.btn.secondary:active,
.btn.neomorphic.active,
.btn-neomorphic.active,
.btn.active {
    transform: translateY(1px);
    box-shadow: inset 4px 4px 12px rgba(0, 0, 0, 0.2), inset -2px -2px 8px rgba(255, 255, 255, 0.1);
}

/* Small Compact Button */
.btn.btn-small,
.btn-neomorphic.btn-small {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border-radius: 16px;
    min-width: 50px;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===========================================
   2. 3D CASE STUDY CARDS
   =========================================== */

.case-study-layout,
.case-grid,
#case-grid {
    perspective: 1200px;
    perspective-origin: center center;
}

.case-card,
.case-study-horizontal-card,
.bento-item {
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

/* 3D Hover Effect - Unified via Variables */
.case-card:hover,
.case-study-horizontal-card:hover,
.bento-item:hover {
    transform: translateZ(40px) rotateY(5deg) rotateX(-5deg);
    /* Shadow is handled by base styles in theme-system.css now, but let's boost it here */
    box-shadow: var(--shadow-strong, 0 20px 60px rgba(0, 0, 0, 0.2));
}

/* Subtle Shimmer Overlay */
.case-card::before,
.case-study-horizontal-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(0, 0, 0, 0.05) 100%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.case-card:hover::before,
.case-study-horizontal-card:hover::before {
    opacity: 1;
}

/* ===========================================
   3. FIXED BEACH BACKGROUND
   =========================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: var(--beach-overlay);
}

/* ===========================================
   4. BEACH VIEW: SUN/MOON + WAVES
   =========================================== */

.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.sun-glow,
.moon-glow {
    position: absolute;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, 60vw);
    height: min(500px, 60vw);
    border-radius: 50%;
    filter: blur(65px);
    opacity: 0.5 !important;
    pointer-events: none;
    z-index: 2;
    transition: all 1.5s ease;
    background: var(--sun-glow-bg, none);
}

/* Moon Logic: If sun-glow-bg is none, show moon-glow-bg? 
   No, CSS variables switch. We just need separate elements if one needs to hide.
   Actually, let's keep it simple: Use .sun-glow for both, just change variable?
   No, HTML has both elements.
*/

/* Conditional Display based on Theme */
:root:not([data-theme="dark"]) .moon-glow {
    display: none;
}

:root[data-theme="dark"] .sun-glow {
    display: none;
}

/* Apply variable backgrounds */
:root:not([data-theme="dark"]) .sun-glow {
    background: var(--sun-glow-bg);
}

:root[data-theme="dark"] .moon-glow {
    background: var(--moon-glow-bg);
}


.hero-waves {
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 120%;
    height: 70%;
    filter: blur(65px);
    pointer-events: none;
    z-index: 1;
    transition: all 2s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform, filter;
    background: var(--wave-gradient);
    opacity: 0.4 !important;
}

/* Hover Interaction */
@media (hover: hover) {
    .hero:hover .hero-waves {
        transform: translateY(-30%) scaleY(1.25);
        filter: blur(60px);
    }
}

/* Ripples */
.hero-waves::before,
.hero-waves::after {
    content: '';
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 100%;
    height: 40%;
    opacity: 0.4;
    pointer-events: none;
}

.hero-waves::before {
    background: var(--wave-ripple-1);
    animation: wave-ripple 8s ease-in-out infinite;
}

.hero-waves::after {
    background: var(--wave-ripple-2);
    animation: wave-ripple 8s ease-in-out 4s infinite;
}

@keyframes wave-ripple {

    0%,
    100% {
        transform: translateY(0) scaleX(1);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-15%) scaleX(1.05);
        opacity: 0.6;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {

    .case-card,
    .hero-waves,
    .sun-glow {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}