/* Grain Texture Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Glass Morphism Cards */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.glass-dark {
    background: rgba(17, 17, 17, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-lime {
    background: rgba(182, 255, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(182, 255, 0, 0.3);
    box-shadow: 
        0 4px 30px rgba(182, 255, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Spotlight Effect */
.spotlight-section {
    position: relative;
    overflow: hidden;
}

.spotlight {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(182, 255, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* Enhanced Card Hover with Glow */
.glass-hover {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 60px rgba(182, 255, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Navigation Glass Effect */
.nav-glass {
    background: rgba(247, 247, 244, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Gradient Mesh Background */
.gradient-mesh {
    position: relative;
    background: linear-gradient(135deg, #F7F7F4 0%, #FAFAF8 50%, #F0F0EC 100%);
}

.gradient-mesh::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(182, 255, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(124, 92, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 62, 247, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 0 0 40px rgba(182, 255, 0, 0.3);
}

/* Button Glass Effect */
.btn-glass {
    background: rgba(182, 255, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(182, 255, 0, 0.5);
    box-shadow: 
        0 4px 15px rgba(182, 255, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-glass:hover {
    background: rgba(182, 255, 0, 1);
    box-shadow: 
        0 8px 30px rgba(182, 255, 0, 0.4),
        0 0 60px rgba(182, 255, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Frosted Image Container */
.img-glass {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.img-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Animated Border Gradient */
.border-gradient {
    position: relative;
    background: white;
    border-radius: 20px;
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #B6FF00, #7C5CFF, #FF3EF7, #B6FF00);
    background-size: 300% 300%;
    border-radius: 22px;
    z-index: -1;
    animation: gradient-rotate 8s ease infinite;
}

@keyframes gradient-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* Shimmer Effect for Loading States */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: #B6FF00;
    border-radius: 50%;
    position: absolute;
    top: -4px;
    left: -4px;
    transition: transform 0.2s ease;
}

.cursor-circle {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(17, 17, 17, 0.5);
    border-radius: 50%;
    position: absolute;
    top: -20px;
    left: -20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cursor-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #111;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hide default cursor on desktop */
@media (pointer: fine) {
    body {
        cursor: none;
    }
    
    a, button {
        cursor: none;
    }
}

/* ============================================
   TEXT SCRAMBLE EFFECT
   ============================================ */
.scramble-char {
    color: #B6FF00;
    font-weight: 600;
}

/* ============================================
   KINETIC TEXT
   ============================================ */
.kinetic-word {
    display: inline-block;
    transform-origin: center bottom;
    perspective: 1000px;
}

/* ============================================
   MAGNETIC BUTTON ENHANCEMENTS
   ============================================ */
.magnetic-wrap {
    display: inline-block;
    position: relative;
}

/* ============================================
   SMOOTH SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    mix-blend-mode: difference;
}

.scroll-indicator::before {
    content: '';
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, #B6FF00, transparent);
    display: block;
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.5); opacity: 0.5; }
}

/* ============================================
   ENHANCED REVEAL ANIMATIONS
   ============================================ */
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

.reveal-rotate {
    opacity: 0;
    transform: rotateX(45deg) translateY(50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-rotate.active {
    opacity: 1;
    transform: rotateX(0) translateY(0);
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #F7F7F4;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-transition.active {
    transform: translateY(0);
}

/* ============================================
   ENHANCED HOVER STATES
   ============================================ */
.hover-glow {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-glow:hover {
    box-shadow: 
        0 0 40px rgba(182, 255, 0, 0.3),
        0 0 80px rgba(182, 255, 0, 0.1);
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */
.icon-bounce {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.group:hover .icon-bounce {
    transform: translateX(4px);
}

/* ============================================
   STAGGERED LIST ANIMATIONS
   ============================================ */
.stagger-list li {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-list.active li {
    opacity: 1;
    transform: translateX(0);
}

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

/* ============================================
   DECORATIVE ELEMENTS
   ============================================ */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(182, 255, 0, 0.3);
    top: 10%;
    right: -10%;
    animation: float-orb 20s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(124, 92, 255, 0.2);
    bottom: 20%;
    left: -5%;
    animation: float-orb 25s ease-in-out infinite reverse;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ============================================
   TYPOGRAPHY ENHANCEMENTS
   ============================================ */
.text-split-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Variable font weight on scroll */
.variable-weight {
    font-variation-settings: 'wght' 400;
    transition: font-variation-settings 0.3s ease;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ============================================
   SMOOTH SCROLL BEHAVIOR
   ============================================ */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .reveal, .reveal-delay-1, .reveal-delay-2, .reveal-delay-3, .reveal-delay-4 {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ============================================
   SELECTION COLOR
   ============================================ */
::selection {
    background: rgba(182, 255, 0, 0.3);
    color: #111111;
}

::-moz-selection {
    background: rgba(182, 255, 0, 0.3);
    color: #111111;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F7F7F4;
}

::-webkit-scrollbar-thumb {
    background: #6B6B6B;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #111111;
}

/* ============================================
   FOCUS STATES FOR ACCESSIBILITY
   ============================================ */
a:focus-visible, button:focus-visible {
    outline: 2px solid #B6FF00;
    outline-offset: 4px;
}

/* ============================================
   IMAGE LOADING STATES
   ============================================ */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[data-src] {
    opacity: 0;
}

/* ============================================
   TEXT BALANCE FOR HEADINGS
   ============================================ */
h1, h2, h3 {
    text-wrap: balance;
}

/* ============================================
   PREVENT LAYOUT SHIFT
   ============================================ */
.container-custom {
    contain: layout;
}

/* ============================================
   WILL-CHANGE FOR PERFORMANCE
   ============================================ */
.hero-card, .glass-hover, .magnetic-wrap {
    will-change: transform;
}

/* ============================================
   REDUCE MOTION RESPECT
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .grain-overlay {
        display: none;
    }
    
    .floating-orb {
        animation: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .grain-overlay,
    .custom-cursor,
    .floating-orb,
    .scroll-indicator,
    nav {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .glass, .glass-dark, .glass-lime {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE SUPPORT
   ============================================ */
@media (prefers-contrast: high) {
    .glass, .glass-dark, .glass-lime {
        border-width: 2px;
    }
    
    .text-text-secondary {
        color: #333;
    }
}
