/* Cinematic Theme Bridge & Overrides */
    --obsidian: #000000;
    --accent: #00d2ff;
    --accent-glow: rgba(34, 211, 238, 0.3);
    --ivory: #f8fafc;

    /* Bridge variables for legacy components like cards-unified.css */
    --color-background: #000000;
    --color-background-light: #000000;
    --color-border: transparent;
    --color-border-dark: transparent;
    --color-text-primary: #f8fafc;
    --color-text-secondary: rgba(248, 250, 252, 0.6);
    --color-text-light: rgba(248, 250, 252, 0.4);
    --color-primary: #22d3ee;
    --color-accent: #22d3ee;

    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.5);

    --font-display: 'Space Grotesk', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* HIGH CONTRAST & PREMIUM GLOW FIXES */
.magnetic-btn {
    transition: transform 0.3s ease, box-shadow 0.4s ease, filter 0.4s ease, color 0.3s ease !important;
}

.magnetic-btn:hover {
    color: #050508 !important;
    box-shadow: 0 0 35px rgba(0, 210, 255, 0.4), 0 0 10px rgba(0, 210, 255, 0.2) !important;
    filter: brightness(1.15);
}

/* Glassmorphism Overrides for Post Cards */
.post-card {
    background: #000000 !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 2.5rem !important;
    /* Premium rounded corners */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    overflow: visible !important;
    /* FIXED: Let the shadow and translation bleed. Mask image corners separately if needed */
}

.post-card:hover {
    transform: translateY(-8px) scale(1.01) !important;
    border-color: rgba(0, 210, 255, 0.3) !important;
    background: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.1) !important;
}

.post-image {
    height: 240px !important;
    /* Más espacio vertical para la imagen */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-top-left-radius: 2.5rem !important;
    border-top-right-radius: 2.5rem !important;
}

.post-category {
    background: var(--accent) !important;
    color: var(--obsidian) !important;
    font-family: 'Space Mono', monospace !important;
    font-size: 10px !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    padding: 4px 12px !important;
    border-radius: 99px !important;
    bottom: 1.5rem !important;
    left: 1.5rem !important;
    font-weight: 700 !important;
}

.post-content {
    padding: 2.5rem 2.5rem 3.5rem 2.5rem !important;
    /* EXPLICIT BOTTOM PADDING TO PREVENT CLIPPING */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
}

.post-excerpt {
    font-family: var(--font-body) !important;
    color: var(--color-text-secondary) !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 2rem !important;
}

.post-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding-top: 1.5rem !important;
}

.post-meta span {
    font-family: 'Space Mono', monospace !important;
    font-size: 11px !important;
    color: rgba(248, 250, 252, 0.4) !important;
}

.post-read-more {
    color: var(--accent) !important;
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

/* Fix for Carousel overlap in index.html */
#posts-container .post-card {
    min-width: 380px !important;
    max-width: 380px !important;
}

/* Features Section Background Ecosystem */
.features-mesh-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(0, 210, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(0, 210, 255, 0.02) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #000000 0%, #000000 100%); /* Absolute Black */
    z-index: -2;
}

.features-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at center, black, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 90%);
    z-index: -1;
    opacity: 0;
}

/* Premium Background Glow Hook */
.premium-bg-glow {
    position: relative;
    overflow: hidden;
}

.premium-bg-glow::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 210, 255, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 210, 255, 0.03) 0%, transparent 40%);
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Protocol Section Optimizations (V9 - Master Timeline) */
.stacking-container-v9 {
    position: relative;
    width: 100%;
    height: 70vh;
    /* Restored to prevent layout gaps */
    perspective: 2000px;
    display: grid;
    place-items: center;
    margin-bottom: 0; /* CHANGED from 5vh to ensure continuity */
    z-index: 5; /* Lower than header */
}

.stack-card-wrapper-v9 {
    width: 100%;
    grid-area: 1 / 1 / 2 / 2;
    will-change: transform, opacity;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Cards are hidden by default via opacity-0 in HTML, 
       but we ensure 3D layering is ready */
    transform-style: preserve-3d;
}

/* Old Stacking (Deprecated but kept for safety during transition) */
.stacking-container {
    overflow: visible;
    z-index: 10;
    perspective: 2000px;
}

.stack-card-wrapper {
    will-change: transform;
}

.stack-card {
    will-change: transform, opacity;
    overflow: hidden;
    transform-origin: center center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: none !important;
    background: #000000 !important; /* Absolute Black Force */
}

/* Protocol Card Premium Backgrounds (CSS Fallbacks) */
.protocol-bg-data {
        linear-gradient(45deg, rgba(34, 211, 238, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(34, 211, 238, 0.05) 25%, transparent 25%);
    background-size: 100% 100%, 30px 30px, 30px 30px;
    opacity: 0.6;
}

.protocol-bg-global {
    background: radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.03), transparent 50%),
                linear-gradient(135deg, #000000 0%, #000000 100%);
}

.protocol-bg-hud {
    background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.03), transparent 70%),
                linear-gradient(180deg, #000000 0%, #000000 100%); /* Force Absolute Black */
}

/* Proteccion de texto para Protocolo */
.stack-card h3 {
    color: #FFFFFF !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.stack-card p {
    color: rgba(248, 250, 252, 0.8) !important;
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

.stack-card .card-image-overlay {
    background: linear-gradient(to bottom, rgba(13, 13, 18, 0.4) 0%, rgba(13, 13, 18, 0.9) 100%);
    opacity: 1 !important;
}

/* Active focus glow */
.stack-card.is-active {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 50px rgba(34, 211, 238, 0.15);
}

.stack-card-content {
    /* Kill transitions on the content wrapper to allow smooth parallax */
    transition: none !important;
}

/* Custom Keyframes for Protocol Visuals */
@keyframes scan-laser {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(180px);
        opacity: 0;
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

/* Apply animations with subtle timing */
.animate-scan-laser {
    animation: scan-laser 4s linear infinite;
}

.animate-spin-slow {
    animation: spin-slow 12s linear infinite;
}

.animate-pulse-soft {
    animation: pulse-soft 3s ease-in-out infinite;
}

@media (max-width: 768px) {
    #posts-container .post-card {
        min-width: 300px !important;
        max-width: 300px !important;
    }
}