/* Base overrides */
html, body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background-color: #050a0f;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    background-attachment: fixed;
}

/* WCAG 2.1 Accessibility: Seizure Prevention & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Cinematic Vignette Overlay - Frames the site like a camera lens */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, transparent 50%, rgba(5, 10, 15, 0.7) 130%);
    pointer-events: none;
    z-index: 40; /* Sits below the nav but above the background */
}

/* Native App Feel: Disable tap highlight on touch devices */
a, button, .node-card, .glass-panel {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background: rgba(0, 229, 255, 0.2);
    color: #ffffff;
}

/* Custom Cursor Management */
@media (pointer: fine) {
    body.custom-cursor-active, 
    body.custom-cursor-active a, 
    body.custom-cursor-active button, 
    body.custom-cursor-active .node-card,
    body.custom-cursor-active .glass-panel {
        cursor: none !important;
    }
}
@media (pointer: coarse) {
    #custom-cursor-dot, #custom-cursor-ring {
        display: none !important;
    }
}

/* Glassmorphism Framework */
.glass-panel {
    background: linear-gradient(145deg, rgba(15, 17, 21, 0.5) 0%, rgba(5, 7, 10, 0.8) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.08);
    border-top: 1px solid rgba(0, 229, 255, 0.25);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.6s ease, box-shadow 0.6s ease;
    will-change: transform, border-color, box-shadow;
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Forces GPU Compositing */
}

/* The Sovereign Sweep - Light reflection on hover */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.08), transparent);
    transform: skewX(-20deg);
    transition: left 0s;
    pointer-events: none;
}

.glass-panel:hover {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 229, 255, 0.25), inset 0 0 20px rgba(0, 229, 255, 0.05);
    transform: translateY(-2px);
}

.glass-panel:hover::before {
    left: 150%;
    transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Majestic Typography */
.cinzel, h1, h2, h3, h4 {
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.gradient-text-gold {
    background: linear-gradient(to right, #0088cc, #e0f7fa, #00e5ff, #0088cc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: textShine 6s linear infinite;
}

@keyframes textShine {
    to { background-position: 200% center; }
}

/* Mystic Gradient Text (Purple, Teal, Gold) */
.gradient-text-mystic {
    background: linear-gradient(to right, #00e5ff, #a855f7, #D4AF37, #00e5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: textShine 8s linear infinite;
}

/* Storm Cloud & Scarlett Gradient */
.gradient-text-storm {
    background: linear-gradient(to right, #94a3b8, #ffffff, #e11d48, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: textShine 8s linear infinite;
}

/* Hardware Accelerated Ambient Glows */
.glow-entity {
    will-change: transform, opacity, filter;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Global GPU Acceleration for heavy background pulse animations */
.animate-pulse-glow {
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
}

/* Scroll Reveal Sequencing */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

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

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* Dynamic Text Highlight Masking */
.scroll-highlight {
    -webkit-mask-image: linear-gradient(to bottom right, #000 var(--scroll-pct, 0%), rgba(0,0,0,0.2) calc(var(--scroll-pct, 0%) + 15%));
    mask-image: linear-gradient(to bottom right, #000 var(--scroll-pct, 0%), rgba(0,0,0,0.2) calc(var(--scroll-pct, 0%) + 15%));
}

/* 9-Dot Matrix Interaction */
.node-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.node-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.glass-panel:hover .node-dot {
    background-color: #D4AF37;
    box-shadow: 0 0 8px #D4AF37;
}

/* Sequential delay for 9-dots on hover */
.glass-panel:hover .node-dot:nth-child(1) { transition-delay: 0.0s; }
.glass-panel:hover .node-dot:nth-child(2) { transition-delay: 0.05s; }
.glass-panel:hover .node-dot:nth-child(3) { transition-delay: 0.1s; }
.glass-panel:hover .node-dot:nth-child(4) { transition-delay: 0.15s; }
.glass-panel:hover .node-dot:nth-child(5) { transition-delay: 0.2s; }
.glass-panel:hover .node-dot:nth-child(6) { transition-delay: 0.25s; }
.glass-panel:hover .node-dot:nth-child(7) { transition-delay: 0.3s; }
.glass-panel:hover .node-dot:nth-child(8) { transition-delay: 0.35s; }
.glass-panel:hover .node-dot:nth-child(9) { transition-delay: 0.4s; }

/* Deep Elements */
.inset-shadow {
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

/* Luxury Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #050a0f;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.6);
}

/* Custom Zero Point Slider */
input[type=range].slider-thumb-gold::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.9), inset 0 0 5px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
input[type=range].slider-thumb-gold::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}
input[type=range].slider-thumb-gold::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.9), inset 0 0 5px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}